Ok I have tried:
$this->assertXpathContentContains('//*[id="message"]', "default");
and
$this->assertXpathContentContains("//*[id='message']", "default");
(note the opposition in quotes)

Neither is working, I am getting the following error in my test.
Failed asserting node denoted by //*[id="message"] CONTAINS content "default"
and
Failed asserting node denoted by //*[id='message'] CONTAINS content "default"
respectively

To no avail, I am running off a great tutorial posted here:
http://www.zendcasts.com/unit-testing-with-the-zend-framework-with-zend_test-and-phpunit/2009/06/
by Jon Lebensold and he shows it as id('message') in his video (and it works 
for him using mamp), I am using Ubuntu/Apache setup here if that makes a 
difference.  The rest of the tutorial works like a charm except that one part 
(maybe I am missing a required library?  I couldn't find any requirements in 
the documentation).  Only requirement in the whole tutorial that I had to track 
down was Xdebug, which I installed for the logging portion.

Any other insights would be great.
Thanks
Aaron


-----Original Message-----
From: Benjamin Eberlei [mailto:[email protected]] 
Sent: December-13-10 8:33 AM
To: [email protected]
Subject: Re: [fw-general] XPath vs Query / Zend Test

xpath would be '//*[id="message"]' afaik

On Sun, 12 Dec 2010 18:50:30 -0700, Aaron Murray <[email protected]>
wrote:
> Hi Everyone,
> 
>  
> 
> Just having a quick problem that probably is due to lack of XPath 
> knowledge.
> 
>  
> 
> This works: $this->assertQueryContentContains("#message", "default");
> 
> This does not work:   $this->assertXpathContentContains("id('message')",
> "default");
> 
>  
> 
> Any thoughts?
> 
> Aaron

Reply via email to