Skip to content

Instantly share code, notes, and snippets.

@andriesss
Last active December 16, 2015 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andriesss/5345848 to your computer and use it in GitHub Desktop.
Save andriesss/5345848 to your computer and use it in GitHub Desktop.
<?php
class DummyTest extends PHPUnit_Framework_TestCase
{
/**
* @group example
* @dataProvider provider
*/
public function testFoo($a)
{
$this->assertEquals($a, $a);
}
public function provider()
{
echo "I am executed!!\n";
return array(
array('foo'),
array('baz'),
array('bar'),
);
}
}
?>
phpunit --exclude-group example DummyTest.php
I am executed!!
PHPUnit 3.7.14 by Sebastian Bergmann.
Time: 0 seconds, Memory: 3.75Mb
No tests executed!
@DragonBe
Copy link

DragonBe commented Apr 9, 2013

<?php
/**
 * @group DummyTest
 */
class DummyTest extends PHPUnit_Framework_TestCase { }

Now when you run phpunit --exclude-group DummyTest it will skip it

See http://www.phpunit.de/manual/current/en/textui.html#textui.clioptions for usage of CLI switches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment