<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Zendcasts Forum / PHPUnit - Select link elements and check if the pages are reachable]]></title>
		<link>http://www.zendcasts.com/forum/viewtopic.php?id=131</link>
		<description><![CDATA[The most recent posts in PHPUnit - Select link elements and check if the pages are reachable.]]></description>
		<lastBuildDate>Wed, 03 Feb 2010 10:40:21 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: PHPUnit - Select link elements and check if the pages are reachable]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?pid=601#p601</link>
			<description><![CDATA[<p>yes, sometimes I wonder myself... <img src="http://www.zendcasts.com/forum/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>Or are you referring to a specific line?</p><p>Complete code looks similar to this:<br />[code=php]<br />&lt;?php<br />/**<br /> * Module Default: IndexControllerTest class<br /> */<br />class IndexControllerTest extends ControllerTestCase<br />{<br />&#160; &#160; <br />&#160; &#160; /* some other tests ... */<br />&#160; &#160; <br />&#160; &#160; <br />&#160; &#160; public function testPageIndexReachable()<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; $this-&gt;dispatch(&quot;/&quot;);<br />&#160; &#160; &#160; &#160; // check if link on currently loaded page exist<br />&#160; &#160; &#160; &#160; $this-&gt;assertQueryContentContains(&#039;a[href=&quot;/index/demo&quot;]&#039;, &#039;Demo&#039;);<br />&#160; &#160; &#160; &#160; $this-&gt;assertModule(&quot;default&quot;);<br />&#160; &#160; &#160; &#160; $this-&gt;assertController(&quot;index&quot;);<br />&#160; &#160; &#160; &#160; $this-&gt;assertAction(&quot;index&quot;);<br />&#160; &#160; &#160; &#160; $this-&gt;assertResponseCode(200);<br />&#160; &#160; }<br />}[/code]</p><p><strong>Update:</strong><br />Maybe you are referring to this line:<br />[code=php]$this-&gt;assertQueryContentContains(&#039;a[href=&quot;/index/demo&quot;]&#039;, &#039;Demo&#039;);[/code]<br />I think the page has to be valid(<strong>!</strong>) XHTML to work properly.</p>]]></description>
			<author><![CDATA[dummy@example.com (udo)]]></author>
			<pubDate>Wed, 03 Feb 2010 10:40:21 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?pid=601#p601</guid>
		</item>
		<item>
			<title><![CDATA[Re: PHPUnit - Select link elements and check if the pages are reachable]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?pid=598#p598</link>
			<description><![CDATA[<p>Udo, does this work?</p>]]></description>
			<author><![CDATA[dummy@example.com (Jon Lebensold)]]></author>
			<pubDate>Wed, 03 Feb 2010 04:13:17 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?pid=598#p598</guid>
		</item>
		<item>
			<title><![CDATA[PHPUnit - Select link elements and check if the pages are reachable]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?pid=596#p596</link>
			<description><![CDATA[<p>Hello,</p><p>How would you approach this challenge:</p><ul><li><p>make PHPUnit select a link from a web page<br />e.g.: &lt;a title=&quot;Demo Title&quot; href=&quot;/index/demo&quot;&gt;Demo&lt;/a&gt;</p></li><li><p>then use the result to check if the page is reachable<br />e.g.: $this-&gt;dispatch(&quot;/index/demo&quot;);</p></li></ul><p>At the moment I&#039;m doing this:<br />[code=php]<br />public function testPageIndexReachable()<br />{<br />&#160; &#160; $this-&gt;dispatch(&quot;/&quot;);<br />&#160; &#160; // check if link on currently loaded page exist<br />&#160; &#160; $this-&gt;assertQueryContentContains(&#039;a[href=&quot;/index/demo&quot;]&#039;, &#039;Demo&#039;);<br />&#160; &#160; $this-&gt;assertModule(&quot;default&quot;);<br />&#160; &#160; $this-&gt;assertController(&quot;index&quot;);<br />&#160; &#160; $this-&gt;assertAction(&quot;index&quot;);<br />&#160; &#160; $this-&gt;assertResponseCode(200);<br />}[/code]<br />Any suggestions?</p><p>Thanks, Udo</p>]]></description>
			<author><![CDATA[dummy@example.com (udo)]]></author>
			<pubDate>Tue, 02 Feb 2010 13:13:04 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?pid=596#p596</guid>
		</item>
	</channel>
</rss>

