【问题标题】:Is there any phpunit function to check whether particular element is present in html table?是否有任何 phpunit 函数来检查 html 表中是否存在特定元素? 【发布时间】:2014-04-26 20:59:58 【问题描述】: 我正在寻找 phpunit 中的方法来获取可以检查特定字符串是否存在于 html 表的任何单元格中的函数。 【问题讨论】: 标签: selenium phpunit 【解决方案1】: 是的,它叫做 assertRegExp():http://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.assertions.assertRegExp assertContains() 也可能对您有所帮助:http://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.assertions.assertContains 【讨论】: