Topic: PHPUnit - Select link elements and check if the pages are reachable
Hello,
How would you approach this challenge:
make PHPUnit select a link from a web page
e.g.: <a title="Demo Title" href="/index/demo">Demo</a>then use the result to check if the page is reachable
e.g.: $this->dispatch("/index/demo");
At the moment I'm doing this:
public function testPageIndexReachable()
{
$this->dispatch("/");
// check if link on currently loaded page exist
$this->assertQueryContentContains('a[href="/index/demo"]', 'Demo');
$this->assertModule("default");
$this->assertController("index");
$this->assertAction("index");
$this->assertResponseCode(200);
}Any suggestions?
Thanks, Udo