<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Connecting the dots... &#187; phpunit</title>
	<atom:link href="http://blog.rajatpandit.com/tag/phpunit/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rajatpandit.com</link>
	<description>Thoughts on Web Development, Infrastructure and Application Scalability</description>
	<lastBuildDate>Thu, 29 Dec 2011 13:21:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>PHPUnit: Installing 3.4.0</title>
		<link>http://blog.rajatpandit.com/2010/04/12/phpunit-installing-3-4-0/</link>
		<comments>http://blog.rajatpandit.com/2010/04/12/phpunit-installing-3-4-0/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 15:47:10 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[continous integration]]></category>
		<category><![CDATA[Phing]]></category>
		<category><![CDATA[phpunit]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=478</guid>
		<description><![CDATA[Strangly enough the following command doesn&#8217;t install the latest version of phpunit for me. I am after 3.4.0 as phing absolutely/definitely wants that version for the whole thing to work....]]></description>
			<content:encoded><![CDATA[<p>Strangly enough the following command doesn&#8217;t install the latest version of phpunit for me.</p>
<pre class="brush: bash; title: ; notranslate">
$ pear channel-discover pear.phpunit.de
$ sudo pear install phpunit/PHPUnit
</pre>
<p>I am after 3.4.0 as phing absolutely/definitely wants that version for the whole thing to work. Here&#8217;s a quite note-to-self on how to get around that.</p>
<p>Download the latest package that needs to be installed from <a href="http://pear.phpunit.de/">http://pear.phpunit.de/</a> and then run the command manually.</p>
<pre class="brush: bash; title: ; notranslate">
p@localhost:~/cfarm$ sudo pear install --alldeps PHPUnit-3.4.12.tgz
WARNING: &quot;pear/DB&quot; is deprecated in favor of &quot;pear/MDB2&quot;
phpunit/PHPUnit can optionally use PHP extension &quot;pdo_sqlite&quot;
pear/Log can optionally use PHP extension &quot;sqlite&quot;
downloading Log-1.12.0.tgz ...
Starting to download Log-1.12.0.tgz (44,555 bytes)
............done: 44,555 bytes
downloading YAML-1.0.3.tgz ...
Starting to download YAML-1.0.3.tgz (9,794 bytes)
...done: 9,794 bytes
downloading DB-1.7.13.tgz ...
Starting to download DB-1.7.13.tgz (132,246 bytes)
...done: 132,246 bytes
downloading MDB2-2.4.1.tgz ...
Starting to download MDB2-2.4.1.tgz (119,790 bytes)
...done: 119,790 bytes
downloading Mail-1.2.0.tgz ...
Starting to download Mail-1.2.0.tgz (23,214 bytes)
...done: 23,214 bytes
downloading Net_SMTP-1.4.2.tgz ...
Starting to download Net_SMTP-1.4.2.tgz (11,826 bytes)
...done: 11,826 bytes
downloading Net_Socket-1.0.9.tgz ...
Starting to download Net_Socket-1.0.9.tgz (5,173 bytes)
...done: 5,173 bytes
downloading Auth_SASL-1.0.4.tgz ...
Starting to download Auth_SASL-1.0.4.tgz (5,795 bytes)
...done: 5,795 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.4.12
install ok: channel://pear.php.net/Log-1.12.0
install ok: channel://pear.symfony-project.com/YAML-1.0.3
install ok: channel://pear.php.net/DB-1.7.13
install ok: channel://pear.php.net/MDB2-2.4.1
install ok: channel://pear.php.net/Mail-1.2.0
install ok: channel://pear.php.net/Net_Socket-1.0.9
install ok: channel://pear.php.net/Auth_SASL-1.0.4
install ok: channel://pear.php.net/Net_SMTP-1.4.2
....
</pre>
<div id="in_post_ad_bottom_1" style="clear:both;margin:0;padding:0;"><div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-bp */
google_ad_slot = "7787511801";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-BP-1 */
google_ad_slot = "9111022353";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2010/04/12/phpunit-installing-3-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP CodeSniffer and common errors</title>
		<link>http://blog.rajatpandit.com/2009/10/01/php-code-sniffer-and-common-errors/</link>
		<comments>http://blog.rajatpandit.com/2009/10/01/php-code-sniffer-and-common-errors/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 14:06:29 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Clean]]></category>
		<category><![CDATA[code sniffer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[phpcs]]></category>
		<category><![CDATA[phpunit]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=382</guid>
		<description><![CDATA[I am currently writing a wrapper for PHPUnit for my employer which makes writing Selenium test cases for developers far easier. It would abstract them from the details of knowing...]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-384" title="sniffer11a" src="http://blog.rajatpandit.com/wp-content/uploads/2009/10/sniffer11a.jpg" alt="sniffer11a" width="322" height="193" />I am currently writing a wrapper for <a href="http://phpunit.de">PHPUnit</a> for my <a href="http://ipcmedia.com">employer</a> which makes writing <a href="http://seleniumhq.org/">Selenium</a> test cases for developers far easier. It would abstract them from the details of knowing server, urls, browser versions, reporting etc. All they now need to do is just write a basic test case for the functionality they added in the sprint and then potentially this can be added into hudson for continuous  integration. This was interesting and requires a blog post to document the classes I extended. However this post is more about the next steps. This also would be a great help for the testing team to amass regression suite written by the developer itself, which if done properly would be of the highest quality.</p>
<p>So the next step was to make a pear package out of it so that other projects could extend out of it and also to free the developer of the include path hell that php offers and as part of the exercise, I ran my code past php code sniffer. However good the tool is, its lacking on part of documentation (or atleast i couldn&#8217;t find much) and its obscure error messages only meant that I would have to dig into the code to find out what exactly it was looking for. So here are some of them of the obscure ones:</p>
<pre class="brush: bash; title: ; notranslate">
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AND 0 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 2 | ERROR | Missing file doc comment
 2 | ERROR | Missing class doc comment
--------------------------------------------------------------------------------
</pre>
<p>There isn&#8217;t any documentation that points out what it actually means with file document and class document. It turns out that it needs documentation about the class as well as the class, usually the same if there is only one level. Here is what I put in my class file to satisfy that.</p>
<pre class="brush: php; title: ; notranslate">
/**
* IPC_Test_Config
*
*
* @category Testing
* @package  IPC.Test
* @author   Rajat Pandit &lt;rajat_pandit@lalaland.com&gt;
* @license  http://www.gnu.org/copyleft/gpl.html GNU General Public License
* @link     http://ipcmedia.com
*/
/**
* IPC_Test_Config
*
* @category Testing
* @package  IPC.Test
* @author   Rajat Pandit &lt;rajat_pandit@lalaland.com&gt;
* @license  http://www.gnu.org/copyleft/gpl.html GNU General Public License
* @link     http://ipcmedia.com
*/
</pre>
<p>Here&#8217;s the next one:</p>
<pre class="brush: bash; title: ; notranslate">
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 10 | WARNING | PHP version not specified
--------------------------------------------------------------------------------
</pre>
<p>Now typically you would expect another @tag but its just <code>* PHP version 5</code> that you need to add. This is what the final version looks like:</p>
<pre class="brush: php; title: ; notranslate">
/**
* IPC_Test_Config
*
* PHP version 5
*
* @category Testing
* @package  IPC.Test
* @author   Rajat Pandit &lt;rajat_pandit@ipcmedia.com&gt;
* @license  http://www.gnu.org/copyleft/gpl.html GNU General Public License
* @link     http://ipcmedia.com
*/
/**
* IPC_Test_Config
*
* @category Testing
* @package  IPC.Test
* @author   Rajat Pandit &lt;rajat_pandit@ipcmedia.com&gt;
* @license  http://www.gnu.org/copyleft/gpl.html GNU General Public License
* @link     http://ipcmedia.com
*/
class IPC_Test_Config
</pre>
<p>I hope this post if useful for anyone who wants to use a code sniffer to ensure that the quality of code is kept to its highest.</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin:0;padding:0;"><div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-bp */
google_ad_slot = "7787511801";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-BP-1 */
google_ad_slot = "9111022353";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2009/10/01/php-code-sniffer-and-common-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

