Problem with AssertTag: children count wrong

From: Date: Wed, 02 May 2012 17:55:02 +0000
Subject: Problem with AssertTag: children count wrong
Groups: php.general 
Request: Send a blank email to php-general+get-317740@lists.php.net to get a copy of this message
Hi List! I'm trying to use phpUnit's AssertTag function to make sure that some html code contains an ul element with exactly li items in it. My test looks like this: function testUnconfiguredFilter() { $matcher = array( 'tag' => 'ul', 'children' => array( 'count' => 3, 'only' => array('tag' => 'li') ) ); $this->assertTag($matcher, $this->html, $message, $isHtml = FALSE); } the value of $html is: <div class="flFilterbox" id="flFilterunconfiguredFilter"> <h3>unconfiguredFilter</h3> <ul class="flFilterboxInner"> <li><a href=""> FilterValue1</a> ()</li> <li><a href=""> FilterValue2</a> ()</li> <li><a href=""> FilterValue3</a> ()</li> </ul> </div> So I think the assertion SHOULD work - but it does not, no matter what I use for count! Sadly PHPUnit's output ist not very helpful, all it gives me is: 1) GeneratedFiltersTest::testUnconfiguredFilter Failed asserting that false is true. Has someone got an idea whats going on? This is really freakin me out, could not find anything about it anywhere on the web. Kind regards, Michael

« previous php.general (#317740) next »