I am using PHPUnit 3.5.x along with Zend 1.10 I have a line in my IndexControllerTestCase.php
$this->assertXpathContentContains("id('message')", "test message");
this shows an error
1) IndexControllerTest::testIndexWithMessageAction
Failed asserting node denoted by id CONTAINS content "test message"
C:\xampp\htdocs\hive\library\Zend\Test\PHPUnit\Constraint\DomQuery.php:256
C:\xampp\htdocs\hive\library\Zend\Test\PHPUnit\ControllerTestCase.php:516
C:\xampp\htdocs\testsample\tests\application\controllers\IndexControllerTest.php
:14
Any idea why this error pops up? Any help would really be appreciated
I'm no XPath wizard, but in our tests we use something like the following to look for the <div> with the id of message.
$this->assertXpathContentContains('//div[@id="message"]', "test message");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With