我正在测试网站的下拉菜单以按名称排序。
$nameSort = array();
$numOfNames = $this->getXpathCount("//td[@class='entry']");
for($count = 1; $count <= $numOfNames; $count ++) {
$get = $this->getText("xpath=(//td/a[contains(@href, '')])[$count]");
array_push($nameSort, $get);
}
$test = sort($entrySort);
$this->assertEquals($entrySort, $test);
但它说“有1次失败:
NameTest::testNameTab true does not match expected type "array".