【发布时间】:2015-10-29 04:13:07
【问题描述】:
我只想对下面的 HTML 数据运行一些断言。在$this->assertEquals(1, ..., "failure"); 里面我试过了:
$crawler->filter('table.table-general > tr > td:contains("<strong>Task ID</strong> 6")')
$crawler->filter('table.table-general > tr > td:contains("<strong>Customer</strong> ABC Inc.")')
$crawler->filter('table.table-general > tr > td:contains("<strong>Location</strong> New York City")')
$crawler->filter('table.table-general > tr > td:contains("<strong>Phone Number</strong> 555-1234")')
但不幸的是它不起作用(断言失败)。我做错了什么?
<table class="table table-curved table-general">
<tr>
<td rowspan="5" width="10%" id="general-task-id"><strong>Task ID</strong><br /><h3>6</h3></td>
<td width="30%"><strong>Customer</strong> ABC Inc.</td>
<td width="30%"><strong>Location</strong> New York City</td>
<td width="30%"><strong>Phone Number</strong> 555-1234</td>
</tr>
...
【问题讨论】:
标签: php symfony phpunit functional-testing