<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Mon, 21 May 2012 07:32:41 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Mike Purcell's Blog: PHPUnit - How to Run PHPUnit Against a Specific Test]]></title>
      <guid>http://www.phpdeveloper.org/news/17476</guid>
      <link>http://www.phpdeveloper.org/news/17476</link>
      <description><![CDATA[<p>
<i>Mike Purcell</i> has a quick new post to his blog showing how you can <a href="http://melikedev.com/2012/01/30/phpunit-how-to-run-phpunit-against-a-specific-test/">run PHPUnit on one specific test</a> using handy grouping functionality already built into the tool.
</p>
<blockquote>
The other day I was debugging an error in one of my unit tests, and found it hard to track down because when I ran PHPUnit, it ran all the tests contained in the file where my problem unit test was located. After some Googling and reading the PHPUnit Api Docs, I found that you can specify a test, among other tests, by adding a comment with the @group annotation.
</blockquote>
<p>
Using this "@group" annotation tells PHPUnit to combine these tests and allows you you specify a "--group" setting on the command line to only run those. He includes some sample code showing how it can be used. This can be very useful for combining results for certain kinds of tests (say, all related to bugfixes) without having to run everything all over again.
</p>]]></description>
      <pubDate>Wed, 01 Feb 2012 08:37:03 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Andrew Eddie's Blog: Making the most out of Code Assist in Eclipse/PDT and Zend Studio for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17198</guid>
      <link>http://www.phpdeveloper.org/news/17198</link>
      <description><![CDATA[<p>
<i>Andrew Eddie</i> has posted a helpful tutorial for Eclipse users out there showing how to <a href="http://www.theartofjoomla.com/home/9-developer/136-making-the-most-out-of-code-assist-in-eclipsepdt-and-zend-studio-for-php.html">get the most our of code assist</a> in Eclipse PDT/Zend Studio.
</p>
<blockquote>
One of the powerful features of an IDE like Eclipse is the ability for it to "read" your code and give you some assistance about your API as you type. This could include things like class property or methods names, constants, functions, argument lists, and so on. Eclipse/PDT and ZendStudio do this by parsing a PHP class directly, but they also look at your docblocks and some other special comments where the raw PHP is not enough. This article is a bag of tricks that help you get the most out of code assistance using Eclipse/PDT or Zend Studio in those awkward corners of your code that you might have through previously inaccessible.
</blockquote>
<p>
Among his tips are things like adding "@var" declarations to help with code completion, type hinting on methods/functions, using the "@property" annotation and using a "this" trick to override what class the IDE sees as the local object.
,/p>]]></description>
      <pubDate>Thu, 01 Dec 2011 12:55:32 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Volker Dusch's Blog: An introduction to PHPUnits @covers annotation]]></title>
      <guid>http://www.phpdeveloper.org/news/17085</guid>
      <link>http://www.phpdeveloper.org/news/17085</link>
      <description><![CDATA[<p>
<a href="http://phpunit.de">PHPUnit</a> is one of the most widely used unit testing tools for PHP applications. It comes packed with features, some that are commonly used and some not so much. In <a href="http://edorian.posterous.com/an-introduction-to-phpunits-covers-annotation">a new post to his blog</a> today <i>Volker Dusch</i> looks at one specific feature - the "@covers" annotation you can use in your tests' comments to specify which functionality you're actually testing.
</p>
<blockquote>
One of the goals of your test suite and the coverage report is to make you trust in your code base and to remove the fear of changing something that needs to be changed. [...] You shouldn't think "Well yes that a 100% but a lot of that just comes from that big integration test and I don't know if the class is really tested!". [...] Thankfully PHPUnit offers a way to drastically increase your confidence in what you actually have tested.
</blockquote>
<p>
Using the "@covers" annotation on your test method docblocks gives you one more level of confidence in what's being tested and can help make for clearer updating down the road. He also mentions using them to provide extra insight into protected methods in your code and where the test coverage for them really lies.
</p>]]></description>
      <pubDate>Fri, 04 Nov 2011 09:55:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint.com: Advanced PHPUnit Testing: Annotations and Mocking]]></title>
      <guid>http://www.phpdeveloper.org/news/15920</guid>
      <link>http://www.phpdeveloper.org/news/15920</link>
      <description><![CDATA[<p>
On SitePoint.com today there's a new article in their unit testing series posted today - a look at <a href="http://blogs.sitepoint.com/2011/02/17/advanced-phpunit-testing-annotations-and-mocking/">annotations and mocking</a> in advanced unit testing with <a href="http://phpunit.de">PHPUnit</a>. (Disclaimer: I am the author of this article series.)
</p>
<blockquote>
PHPUnit has lots of advanced features that can be amazingly helpful when that special case comes around. This includes extending the framework itself, making test suites, building static datasets, and the focus of this article: annotations and mocking. Don't worry if you're unsure what either of these are; I'm here to help. I trust by the end that you'll see how these two features can be useful to both you and your tests.
</blockquote>
<p>
The article starts with annotations showing how they can be used both on the class side to help with test generation and on the test side to help in evaluation (like expectedException). In the mocking section, it shows you how create simple and complex mock objects to replace a sample database query.
</p>]]></description>
      <pubDate>Thu, 17 Feb 2011 09:33:08 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: On annotations and logic]]></title>
      <guid>http://www.phpdeveloper.org/news/15826</guid>
      <link>http://www.phpdeveloper.org/news/15826</link>
      <description><![CDATA[<p>
On the Stubbles blog there's <a href="http://www.stubbles.org/archives/91-On-annotations-and-logic.html">a recent post</a> that talks about a feature they introduced into the framework - annotations - with high hopes it would give them more flexibility in how things worked. As <i>Frank Keline</i> says, though, "it's not such a good idea at all".
</p>
<blockquote>
The most simplest reason for this is the idea that annotations are markup. They mark (or, to keep the notion, annotate) code as being special or to be treated in some special kind of way, depending on the scenario where the code is used in. [...] From a design point of view this makes it clear why annotations should not contain logic. If annotations contain parts of such logic, it becomes splitted and possibly cluttered throughout different classes.
</blockquote>
<p>
He goes on to talk about a second reason why he doesn't think they should be considered first-class in an application - it doesn't promote code reuse. For example, if you define them on a method, there's no way to use that method without them. He puts this into the perspective of the <a href="http://stubbles.net/">Stubbles</a> framework that currently uses them and how he's changed the logic to live in special classes instead. He considers other changes like places annotations can be used and having different annotation classes.</p>]]></description>
      <pubDate>Fri, 28 Jan 2011 12:29:40 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Change Garcia's Blog: expected exceptions annotations, mocked object calls, oh my.]]></title>
      <guid>http://www.phpdeveloper.org/news/15646</guid>
      <link>http://www.phpdeveloper.org/news/15646</link>
      <description><![CDATA[<p>
<i>Chance Gracia</i> came across an interesting feature/bug when writing up unit tests for his application with <a href="http://phpunit.de">PHPUnit</a>. He was throwing an exception from a mock object and based on his annotation <a href="http://phpprotip.com/2010/12/expected-exceptions-annotations-mocked-object-calls-oh-my/">the exception is caught no matter the type</a>.
</p>
<blockquote>
Anyone who has worked with PHPUnit has most likely worked with expected exceptions and mock objects. The nice thing about working with expected exceptions is that we have access to a handy @expectedException annotation. I've gotten into the habit of using this for exceptions my fixtures should throw but also for when I'm using a mock object to verify a method call. 
</blockquote>
<p>
Some sample code is included to show his problem - a mock object is created for the "foo" class and a test to see if an Exception type is thrown is included on it. The problem is that the exception thrown isn't of type Exception, but of type "foo_exception" and the @expectedException annotation tells it to look for the Exception type. Because of this unpredictable behavior, he suggests not using annotations for these sort of tests or it could lead to false positives. 
</p>]]></description>
      <pubDate>Tue, 28 Dec 2010 11:42:27 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPClasses.org: Lately in PHP Ep. 6 - Unusual Site Speedup Techniques, Named params & Annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/15359</guid>
      <link>http://www.phpdeveloper.org/news/15359</link>
      <description><![CDATA[<p>
On the PHPClasses.org site today they've posted the <a href="http://www.phpclasses.org/blog/post/134-Unusual-Site-Speedup-Techniques-debate-Named-parameters-and-Annotations--Lately-in-PHP-podcast-episode-6.html">latest episode</a> in their "Lately in PHP" podcast series - "Unusual Site Speedup Techniques debate, Named parameters and Annotations".
</p>
<blockquote>
In this episode, Manuel Lemos and Ernani Joppert discuss several unusual site speedup techniques presented in recent articles of the PHPClasses site blog. They also discuss the (non-)inclusion of new PHP features discussed by PHP core developers like having named parameters in function calls and the support of Java-like annotations in PHP code.
</blockquote>
<p>
To listen you can either use the <a href="http://www.phpclasses.org/blog/post/134-Unusual-Site-Speedup-Techniques-debate-Named-parameters-and-Annotations--Lately-in-PHP-podcast-episode-6.html">in-page player</a>, grab it <a href="http://itunes.apple.com/podcast/lately-in-php-podcast/id373016482">from iTunes</a> or just download <a href="http://www.phpclasses.org/blog/post/134/file/27/name/Lately-In-PHP-6.mp3">the mp3</a>. Complete show notes and transcript are also included in <a href="http://www.phpclasses.org/blog/post/134-Unusual-Site-Speedup-Techniques-debate-Named-parameters-and-Annotations--Lately-in-PHP-podcast-episode-6.html">the post</a>.
</p>]]></description>
      <pubDate>Mon, 01 Nov 2010 08:29:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: State of annotations in the PHP world]]></title>
      <guid>http://www.phpdeveloper.org/news/11380</guid>
      <link>http://www.phpdeveloper.org/news/11380</link>
      <description><![CDATA[<p>
In <A href="http://www.stubbles.org/archives/54-State-of-annotations-in-the-PHP-world.html">this new post</a> to the Stubbles blog <i>Frank Kleine</i> looks at the current state of annotations in the PHP language and applications.
</p>
<blockquote>
Annotations are a really helpful feature in present-day development. An annotation is a special form of syntactic metadata that can be added to source code elements such as classes, methods, properties and parameters. They do not affect the program semantic directly, but can be used by tools and libraries to handle such annotated code in a certain way.
</blockquote>
<p>
He notes that, as of right now, PHP doesn't naively support anything like this but that there are additional libraries that can be used to augment the standard PHP performance and use them (like a feature in <a href="http://www.phpunit.de">PHPUnit</a> with @assert and @test). He also go through several of the other libraries that make it possible including <a href="http://www.stubbles.org/exit.php?url_id=358&entry_id=54">Addendum</a>, <a href="http://www.stubbles.org/exit.php?url_id=363&entry_id=54">FLOW3</a> and the <a href="http://www.stubbles.org/exit.php?url_id=368&entry_id=54">XP-Framework</a>.
</p>]]></description>
      <pubDate>Mon, 10 Nov 2008 13:32:59 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mike Naberezny's Blog: Better PHPUnit Group Annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/8585</guid>
      <link>http://www.phpdeveloper.org/news/8585</link>
      <description><![CDATA[<p>
<i>Mike Naberezny</i> has <a href="http://mikenaberezny.com/archives/79">posted about</a> some improvements that were made to the <a href="http://www.phpunit.de">PHPUnit</a> testing software lately (<a href="http://www.phpdeveloper.org/news/8581">support for TestNG-style groupings</a>) and how, with a few of his own suggestions it was made a bit more flexible.
</p>
<blockquote>
At <a href="http://maintainable.com/">my company</a>, we typically organize our test case classes into high-level groups such as unit and functional. Method-level group annotations are inconvenient for us because we'd need to annotate every method of every test case class.
</blockquote>
<p>
He <a href="http://mikenaberezny.com/archives/79">includes an example</a> of their use - commenting a testing class and running it through the phpunit command line tool with a call to the testing group's name.
</p>]]></description>
      <pubDate>Thu, 04 Sep 2008 21:48:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: More PHP6 Wishlist Talk (Annotations)]]></title>
      <guid>http://www.phpdeveloper.org/news/7354</guid>
      <link>http://www.phpdeveloper.org/news/7354</link>
      <description><![CDATA[<p>
<i>Frank</i> and <i>Stehpan</i> has posted <a href="http://www.stubbles.org/archives/8-My-wishlist-for-PHP-6,-pt3-Annotations.html">two</a> <a href="http://www.stubbles.org/archives/9-Wishlist-pt-3-opposed-specifications-instead-annotations.html">more</a> items in their "PHP6 wishlist" series" today - both mentioning annotations.
</p>
<p>
In <a href="http://www.stubbles.org/archives/8-My-wishlist-for-PHP-6,-pt3-Annotations.html">Stephan's post</a>:
<blockquote>
Porting JavaDoc comments to PHP was one of the best things, that ever happened to to PHP4. But like in Java 4, the DocBlocks in PHP evolved from plain documentation to a feature that adds meta information to classes, methods, properties and variables. IDEs, like Zend Studio, use the @var tag to enable type hinting for method return values, which would not possible without the DocBlock, as PHP is a dynamic languages.
</blockquote>
<p>
And from <i>Frank</i>:
</p>
<blockquote>
In <a href="http://www.stubbles.org/archives/8-My-wishlist-for-PHP-6,-pt3-Annotations.html">part three of his wishlist</a> for PHP 6 Stephan wrote that he would like to see annotations built into PHP 6 directly. I disagree with him about that. Annotations can be done in userland, without any problems. He already gave some examples of projects that accomplished this task. But if you look at them you see that every project has a different solution on how to implement annotations for PHP which leads to the problem that if you use different projects in your own application you have to handle all their ways of treating annotations. Annoying, isn't it?
</blockquote>]]></description>
      <pubDate>Tue, 27 Feb 2007 13:02:00 -0600</pubDate>
    </item>
  </channel>
</rss>

