Phpunit 错误 - 断言节点失败,表示为
我正在使用 PHPUnit 3.5.x 和 Zend 1.10 我的 IndexControllerTestCase.php 中有一行
$this->assertXpathContentContains("id('message')", "test message");
显示错误
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
知道为什么会弹出此错误吗?任何帮助将不胜感激
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不是 XPath 向导,但在我们的测试中,我们使用类似以下内容来查找
message
的id
。I'm no XPath wizard, but in our tests we use something like the following to look for the <div> with the
id
ofmessage
.