News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mike Purcell's Blog:
PHPUnit - How to Run PHPUnit Against a Specific Test
February 01, 2012 @ 08:37:03

Mike Purcell has a quick new post to his blog showing how you can run PHPUnit on one specific test using handy grouping functionality already built into the tool.

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.

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.

0 comments voice your opinion now!
phpunit specific test group annotation


blog comments powered by Disqus

Similar Posts

Matthew Weir O'Phinney's Blog: Getting XDebug working with PHPUnit for code coverage reports

AjaxRay.com: Setting up Database testing with Kohana UnitTest module

Sebastian Bergmann's Blog: AJAX-Based Test Runner for PHPUnit

Felix Geisendorfer's Blog: CakePHP Bleeding Edge - Google Group

Zend Developer Zone: phpt Generator Up


Community Events





Don't see your event here?
Let us know!


release interview laravel zendserver library community voicesoftheelephpant bugfix podcast api series install package symfony introduction framework unittest opinion deployment language

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework