Permalink
Browse files

- Merge [3451], [3452], and [3453].

  • Loading branch information...
1 parent c8e28d6 commit 15cd3c3ed72fd585191035aaee9bee94ae04291d @sebastianbergmann committed Jul 14, 2008
Showing with 50 additions and 17 deletions.
  1. +1 −3 PHPUnit/Extensions/PhptTestCase.php
  2. +31 −14 PHPUnit/Framework/TestCase.php
  3. +17 −0 PHPUnit/Tests/TextUI/list-groups.phpt
  4. +1 −0 package.xml
@@ -201,9 +201,7 @@ public function run(PHPUnit_Framework_TestResult $result = NULL, $options = arra
$this,
PHPUnit_Framework_ComparisonFailure::diffEqual(
file_get_contents($expFile),
- file_get_contents($outFile),
- FALSE,
- $this->getName()
+ file_get_contents($outFile)
),
$time
);
@@ -957,22 +957,39 @@ protected function tearDown()
*/
protected function cleanupGlobals()
{
- $GLOBALS = array();
- $_ENV = array();
- $HTTP_ENV_VARS = array();
- $argv = array();
- $argc = array();
- $_POST = array();
- $HTTP_POST_VARS = array();
- $_GET = array();
- $HTTP_GET_VARS = array();
- $_COOKIE = array();
+ $_ENV = array();
+ $HTTP_ENV_VARS = array();
+ $argv = array();
+ $argc = array();
+ $_POST = array();
+ $HTTP_POST_VARS = array();
+ $_GET = array();
+ $HTTP_GET_VARS = array();
+ $_COOKIE = array();
$HTTP_COOKIE_VARS = array();
- $_SERVER = array();
+ $_SERVER = array();
$HTTP_SERVER_VARS = array();
- $_FILES = array();
- $HTTP_POST_FILES = array();
- $_REQUEST = array();
+ $_FILES = array();
+ $HTTP_POST_FILES = array();
+ $_REQUEST = array();
+
+ $GLOBALS = array(
+ '_ENV' => &$_ENV,
+ 'HTTP_ENV_VARS' => &$HTTP_ENV_VARS,
+ 'argv' => &$argv,
+ 'argc' => &$argc,
+ '_POST' => &$_POST,
+ 'HTTP_POST_VARS' => &$HTTP_POST_VARS,
+ '_GET' => &$_GET,
+ 'HTTP_GET_VARS' => &$HTTP_GET_VARS,
+ '_COOKIE' => &$_COOKIE,
+ 'HTTP_COOKIE_VARS' => &$HTTP_COOKIE_VARS,
+ '_SERVER' => &$_SERVER,
+ 'HTTP_SERVER_VARS' => &$HTTP_SERVER_VARS,
+ '_FILES' => &$_FILES,
+ 'HTTP_POST_FILES' => &$HTTP_POST_FILES,
+ '_REQUEST' => &$_REQUEST
+ );
}
}
@@ -0,0 +1,17 @@
+--TEST--
+phpunit --list-groups BankAccountTest ../../Samples/BankAccount/BankAccountTest.php
+--FILE--
+<?php
+$_SERVER['argv'][1] = '--list-groups';
+$_SERVER['argv'][2] = 'BankAccountTest';
+$_SERVER['argv'][3] = '../Samples/BankAccount/BankAccountTest.php';
+
+require_once dirname(dirname(dirname(__FILE__))) . '/TextUI/Command.php';
+?>
+--EXPECT--
+PHPUnit @package_version@ by Sebastian Bergmann.
+
+Available test group(s):
+ - balanceIsInitiallyZero
+ - balanceCannotBecomeNegative
+
View
@@ -801,6 +801,7 @@
<file baseinstalldir="/" name="group.phpt" role="test" />
<file baseinstalldir="/" name="help2.phpt" role="test" />
<file baseinstalldir="/" name="help.phpt" role="test" />
+ <file baseinstalldir="/" name="list-groups.phpt" role="test" />
<file baseinstalldir="/" name="log-graphviz.phpt" role="test" />
<file baseinstalldir="/" name="log-json.phpt" role="test" />
<file baseinstalldir="/" name="log-tap.phpt" role="test" />

0 comments on commit 15cd3c3

Please sign in to comment.