TestNG-style Grouping of Tests in PHPUnit 3.2

Sebastian Bergmann » 31 August 2007 » in New Features » 0 Comments

Starting with version 3.2, PHPUnit has support for TestNG-style @grouping of tests:
<?php
class TestTest extends PHPUnit_Framework_TestCase
{
    /**
     * @group a
     */
    public function testOne()
    {
    }
 
    /**
     * @group a
     * @group b
     */
    public function testTwo()
    {
    }
}
?>
You can select a test group from a test suite using --group with the TextUI test runner:
sb@vmware ~ % phpunit --group a TestTest
PHPUnit 3.2.0-dev by Sebastian Bergmann.

..

Time: 0 seconds


OK (2 tests)
sb@vmware ~ % phpunit --group b TestTest
PHPUnit 3.2.0-dev by Sebastian Bergmann.

.

Time: 0 seconds


OK (1 test)
Defined tags for this entry: , , ,

Trackback specific URI for this entry

0 Comments to "TestNG-style Grouping of Tests in PHPUnit 3.2"

Display comments as (Linear | Threaded)
  1. No comments

1 Trackback to "TestNG-style Grouping of Tests in PHPUnit 3.2"

  1. Sebastian Bergmann 28/10/2007 at 18:29
    I have just released a first release candidate for PHPUnit 3.2, the next major version of the xUnit testing framework for PHP. Highlights of this new release include software metrics, project mess detection, copy-and-paste detection, improvements to Se

Add Comment


To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Submitted comments will be subject to moderation before being displayed.