Permalink
Browse files

Tests for group filtering issue when the phpunit.xml and commandline …

…flags are used. Closes #322
  • Loading branch information...
1 parent 2035c96 commit c8fc939dc0f2f99b073357cc93d7be817b8a207d @edorian edorian committed Jul 27, 2012
@@ -0,0 +1,28 @@
+--TEST--
+GH-322: group commandline option should override group/exclude setting in phpunit.xml
+--FILE--
+<?php
+
+$_SERVER['argv'][1] = '--configuration';
+$_SERVER['argv'][2] = dirname(__FILE__).'/322/phpunit322.xml';
+$_SERVER['argv'][3] = '--debug';
+$_SERVER['argv'][4] = '--group';
+$_SERVER['argv'][5] = 'one';
+$_SERVER['argv'][6] = 'Issue322Test';
+$_SERVER['argv'][7] = dirname(__FILE__).'/322/Issue322Test.php';
+
+require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php';
+PHPUnit_TextUI_Command::main();
+?>
+--EXPECTF--
+PHPUnit %s by Sebastian Bergmann.
+
+Configuration read from %s
+
+
+Starting test 'Issue322Test::testOne'.
+.
+
+Time: %i %s, Memory: %sMb
+
+OK (1 test, 0 assertions)
@@ -0,0 +1,17 @@
+<?php
+class Issue322Test extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @group one
+ */
+ public function testOne()
+ {
+ }
+
+ /**
+ * @group two
+ */
+ public function testTwo()
+ {
+ }
+}
@@ -0,0 +1,11 @@
+<phpunit>
+ <testsuite name="My Test Suite">
+ <file>Test.php</file>
+ </testsuite>
+
+ <groups>
+ <exclude>
+ <group>one</group>
+ </exclude>
+ </groups>
+</phpunit>

0 comments on commit c8fc939

Please sign in to comment.