views:

47

answers:

0

Hi,

What is the best way to verify that a link with a specific url and content exists on a tested page? I'm using Zend_Test and the following simplified example works fine until there is a dot (".") in the url, which obviously can happen very often...

This is OK:

$this->assertQueryContentContains('a[href="/index"]', 'Home');

Now if I try:

$this->assertQueryContentContains('a[href="/index.html"]', 'Home');

I will end up with the following error:

DOMXPath::query(): Invalid expression

Am I missing some more intelligent way of veryfing links and urls in my tests?

Is there a way to escape the dot so that XPath does not complain?