cvs: pear /PHPUnit/Extensions ExceptionTestCase.php PerformanceTestCase.php /PHPUnit/Framework ComparisonFailure.php TestCase.php TestFailure.php
TestResult.php TestSuite.php /PHPUnit/Tests WasRun.php /PHPUnit/Tests/Framework DoubleTestCase.php SuiteTest.php TestImplementorTest.php
TestListenerTest.php /PHPUnit/TextUI ResultPrinter.php TestRunner.php
| From: | Sebastian Bergmann | Date: | Sun, 04 Jan 2004 10:25:12 +0000 |
| Subject: | cvs: pear /PHPUnit/Extensions ExceptionTestCase.php PerformanceTestCase.php /PHPUnit/Framework ComparisonFailure.php TestCase.php TestFailure.php TestResult.php TestSuite.php /PHPUnit/Tests WasRun.php /PHPUnit/Tests/Framework DoubleTestCase.php SuiteTest.php TestImplementorTest.php TestListenerTest.php /PHPUnit/TextUI ResultPrinter.php TestRunner.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-15332@lists.php.net to get a copy of this message | ||
sebastian Sun Jan 4 05:25:12 2004 EDT
Modified files:
/pear/PHPUnit/Extensions ExceptionTestCase.php
PerformanceTestCase.php
/pear/PHPUnit/Framework ComparisonFailure.php TestCase.php
TestFailure.php TestResult.php
TestSuite.php
/pear/PHPUnit/Tests WasRun.php
/pear/PHPUnit/Tests/Framework DoubleTestCase.php SuiteTest.php
TestImplementorTest.php
TestListenerTest.php
/pear/PHPUnit/TextUI ResultPrinter.php TestRunner.php
Log:
s/->f/->/
Index: pear/PHPUnit/Extensions/ExceptionTestCase.php diff -u pear/PHPUnit/Extensions/ExceptionTestCase.php:1.4 pear/PHPUnit/Extensions/ExceptionTestCase.php:1.5 --- pear/PHPUnit/Extensions/ExceptionTestCase.php:1.4 Thu Jan 1 05:31:40 2004 +++ pear/PHPUnit/Extensions/ExceptionTestCase.php Sun Jan 4 05:25:09 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: ExceptionTestCase.php,v 1.4 2004/01/01 10:31:40 sebastian Exp $ +// $Id: ExceptionTestCase.php,v 1.5 2004/01/04 10:25:09 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; @@ -33,7 +33,7 @@ * @var string * @access private */ - private $fExpected = ''; + private $expected = ''; // }}} // {{{ public function __construct($name, $exception) @@ -45,7 +45,7 @@ */ public function __construct($name, $exception) { parent::__construct($name); - $this->fExpected = $exception; + $this->expected = $exception; } // }}} @@ -60,14 +60,14 @@ } catch (Exception $e) { - if (is_a($e, $this->fExpected)) { + if (is_a($e, $this->expected)) { return; } else { throw $e; } } - $this->fail('Expected exception ' . $this->fExpected); + $this->fail('Expected exception ' . $this->expected); } // }}} Index: pear/PHPUnit/Extensions/PerformanceTestCase.php diff -u pear/PHPUnit/Extensions/PerformanceTestCase.php:1.4 pear/PHPUnit/Extensions/PerformanceTestCase.php:1.5 --- pear/PHPUnit/Extensions/PerformanceTestCase.php:1.4 Thu Jan 1 05:31:40 2004 +++ pear/PHPUnit/Extensions/PerformanceTestCase.php Sun Jan 4 05:25:09 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: PerformanceTestCase.php,v 1.4 2004/01/01 10:31:40 sebastian Exp $ +// $Id: PerformanceTestCase.php,v 1.5 2004/01/04 10:25:09 sebastian Exp $ // require_once 'Benchmark/Timer.php'; @@ -33,7 +33,7 @@ * @var double * @access private */ - private $fMaxRunningTime = 0; + private $maxRunningTime = 0; // }}} // {{{ public function __construct($name, $maxRunningTime = 0) @@ -45,7 +45,7 @@ */ public function __construct($name, $maxRunningTime = 0) { parent::__construct($name); - $this->fMaxRunningTime = $maxRunningTime; + $this->maxRunningTime = $maxRunningTime; } // }}} @@ -61,13 +61,13 @@ parent::runTest(); $timer->stop(); - if ($this->fMaxRunningTime != 0 && - $timer->timeElapsed() > $this->fMaxRunningTime) { + if ($this->maxRunningTime != 0 && + $timer->timeElapsed() > $this->maxRunningTime) { PHPUnit_Framework_Assert::fail( sprintf( 'expected running time: <= %s but was: %s', - $this->fMaxRunningTime, + $this->maxRunningTime, $timer->timeElapsed() ) ); Index: pear/PHPUnit/Framework/ComparisonFailure.php diff -u pear/PHPUnit/Framework/ComparisonFailure.php:1.7 pear/PHPUnit/Framework/ComparisonFailure.php:1.8 --- pear/PHPUnit/Framework/ComparisonFailure.php:1.7 Thu Jan 1 05:31:42 2004 +++ pear/PHPUnit/Framework/ComparisonFailure.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: ComparisonFailure.php,v 1.7 2004/01/01 10:31:42 sebastian Exp $ +// $Id: ComparisonFailure.php,v 1.8 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/AssertionFailedError.php'; @@ -30,13 +30,13 @@ * @var string * @access private */ - private $fExpected = ''; + private $expected = ''; /** * @var string * @access private */ - private $fActual = ''; + private $actual = ''; // }}} // {{{ public function __construct($expected, $actual, $message = '') @@ -52,8 +52,8 @@ public function __construct($expected, $actual, $message = '') { parent::__construct($message); - $this->fExpected = $expected; - $this->fActual = $actual; + $this->expected = $expected; + $this->actual = $actual; } // }}} @@ -67,48 +67,48 @@ * @access public */ public function toString() { - if ($this->fExpected == null && $this->fActual == null) { + if ($this->expected == null && $this->actual == null) { return PHPUnit_Framework_Assert::format( - $this->fExpected, - $this->fActual, + $this->expected, + $this->actual, parent::getMessage() ); } - $end = min(strlen($this->fExpected), strlen($this->fActual)); + $end = min(strlen($this->expected), strlen($this->actual)); $i = 0; - $j = strlen($this->fExpected) - 1; - $k = strlen($this->fActual) - 1; + $j = strlen($this->expected) - 1; + $k = strlen($this->actual) - 1; for (; $i < $end; $i++) { - if ($this->fExpected[$i] != $this->fActual[$i]) { + if ($this->expected[$i] != $this->actual[$i]) { break; } } for (; $k >= $i && $j >= $i; $k--,$j--) { - if ($this->fExpected[$j] != $this->fActual[$k]) { + if ($this->expected[$j] != $this->actual[$k]) { break; } } if ($j < $i && $k < $i) { - $expected = $this->fExpected; - $actual = $this->fActual; + $expected = $this->expected; + $actual = $this->actual; } else { - $expected = substr($this->fExpected, $i, ($j + 1 - $i)); - $actual = substr($this->fActual, $i, ($k + 1 - $i));; + $expected = substr($this->expected, $i, ($j + 1 - $i)); + $actual = substr($this->actual, $i, ($k + 1 - $i));; if ($i <= $end && $i > 0) { $expected = '...' . $expected; $actual = '...' . $actual; } - if ($j < strlen($this->fExpected) - 1) { + if ($j < strlen($this->expected) - 1) { $expected .= '...'; } - if ($k < strlen($this->fActual) - 1) { + if ($k < strlen($this->actual) - 1) { $actual .= '...'; } Index: pear/PHPUnit/Framework/TestCase.php diff -u pear/PHPUnit/Framework/TestCase.php:1.15 pear/PHPUnit/Framework/TestCase.php:1.16 --- pear/PHPUnit/Framework/TestCase.php:1.15 Sat Jan 3 12:28:10 2004 +++ pear/PHPUnit/Framework/TestCase.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestCase.php,v 1.15 2004/01/03 17:28:10 sebastian Exp $ +// $Id: TestCase.php,v 1.16 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/Assert.php'; @@ -36,16 +36,16 @@ * Here is an example: * * class MathTest extends PHPUnit_Framework_TestCase { - * public $fValue1; - * public $fValue2; + * public $value1; + * public $value2; * * public function __construct($name) { * parent::__construct($name); * } * * public function setUp() { - * $this->fValue1 = 2; - * $this->fValue2 = 3; + * $this->value1 = 2; + * $this->value2 = 3; * } * } * @@ -54,7 +54,7 @@ * assert with a boolean. * * public function testPass() { - * $this->assertTrue($this->fValue1 + $this->fValue2 == 5); + * $this->assertTrue($this->value1 + $this->value2 == 5); * } * * @abstract @@ -78,7 +78,7 @@ * @var string * @access private */ - private $fName = null; + private $name = null; // }}} // {{{ public function __construct($name = false) @@ -151,7 +151,7 @@ * @access public */ public function getName() { - return $this->fName; + return $this->name; } // }}} @@ -206,11 +206,11 @@ * @access protected */ protected function runTest() { - self::assertNotNull($this->fName); + self::assertNotNull($this->name); try { $class = new Reflection_Class($this); - $method = $class->getMethod($this->fName); + $method = $class->getMethod($this->name); } catch (Exception $e) { @@ -242,7 +242,7 @@ * @access public */ public function setName($name) { - $this->fName = $name; + $this->name = $name; } // }}} Index: pear/PHPUnit/Framework/TestFailure.php diff -u pear/PHPUnit/Framework/TestFailure.php:1.6 pear/PHPUnit/Framework/TestFailure.php:1.7 --- pear/PHPUnit/Framework/TestFailure.php:1.6 Thu Jan 1 05:31:42 2004 +++ pear/PHPUnit/Framework/TestFailure.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestFailure.php,v 1.6 2004/01/01 10:31:42 sebastian Exp $ +// $Id: TestFailure.php,v 1.7 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/Test.php'; @@ -30,13 +30,13 @@ * @var PHPUnit_Framework_Test * @access protected */ - protected $fFailedTest; + protected $failedTest; /** * @var Exception * @access protected */ - protected $fThrownException; + protected $thrownException; // }}} // {{{ public function __construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException) @@ -49,8 +49,8 @@ * @access public */ public function __construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException) { - $this->fFailedTest = $failedTest; - $this->fThrownException = $thrownException; + $this->failedTest = $failedTest; + $this->thrownException = $thrownException; } // }}} @@ -66,8 +66,8 @@ return sprintf( '%s: %s', - $this->fFailedTest, - $this->fThrownException->getMessage() + $this->failedTest, + $this->thrownException->getMessage() ); } @@ -81,7 +81,7 @@ * @access public */ public function failedTest() { - return $this->fFailedTest; + return $this->failedTest; } // }}} @@ -94,7 +94,7 @@ * @access public */ public function thrownException() { - return $this->fThrownException; + return $this->thrownException; } // }}} Index: pear/PHPUnit/Framework/TestResult.php diff -u pear/PHPUnit/Framework/TestResult.php:1.7 pear/PHPUnit/Framework/TestResult.php:1.8 --- pear/PHPUnit/Framework/TestResult.php:1.7 Sat Jan 3 12:28:10 2004 +++ pear/PHPUnit/Framework/TestResult.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestResult.php,v 1.7 2004/01/03 17:28:10 sebastian Exp $ +// $Id: TestResult.php,v 1.8 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/AssertionFailedError.php'; @@ -33,31 +33,31 @@ * @var array * @access protected */ - protected $fErrors = array(); + protected $errors = array(); /** * @var array * @access protected */ - protected $fFailures = array(); + protected $failures = array(); /** * @var array * @access protected */ - protected $fListeners = array(); + protected $listeners = array(); /** * @var integer * @access protected */ - protected $fRunTests = 0; + protected $runTests = 0; /** * @var boolean * @access private */ - private $fStop = false; + private $stop = false; /** * Code Coverage information provided by Xdebug. @@ -79,9 +79,9 @@ * @access public */ public function addError(PHPUnit_Framework_Test $test, Exception $e) { - $this->fErrors[] = new PHPUnit_Framework_TestFailure($test, $e); + $this->errors[] = new PHPUnit_Framework_TestFailure($test, $e); - foreach ($this->fListeners as $listener) { + foreach ($this->listeners as $listener) { $listener->addError($test, $e); } } @@ -98,9 +98,9 @@ * @access public */ public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e) { - $this->fFailures[] = new PHPUnit_Framework_TestFailure($test, $e); + $this->failures[] = new PHPUnit_Framework_TestFailure($test, $e); - foreach ($this->fListeners as $listener) { + foreach ($this->listeners as $listener) { $listener->addFailure($test, $e); } } @@ -115,7 +115,7 @@ * @access public */ public function addListener(PHPUnit_Framework_TestListener $listener) { - $this->fListeners[] = $listener; + $this->listeners[] = $listener; } // }}} @@ -130,7 +130,7 @@ public function endTest(PHPUnit_Framework_Test $test) { $this->codeCoverageInformation[$test->getName()] = $test->getCodeCoverageInformation(); - foreach ($this->fListeners as $listener) { + foreach ($this->listeners as $listener) { $listener->endTest($test); } } @@ -145,7 +145,7 @@ * @access public */ public function errorCount() { - return sizeof($this->fErrors); + return sizeof($this->errors); } // }}} @@ -158,7 +158,7 @@ * @access public */ public function errors() { - return $this->fErrors; + return $this->errors; } // }}} @@ -171,7 +171,7 @@ * @access public */ public function failureCount() { - return sizeof($this->fFailures); + return sizeof($this->failures); } // }}} @@ -184,7 +184,7 @@ * @access public */ public function failures() { - return $this->fFailures; + return $this->failures; } // }}} @@ -210,9 +210,9 @@ * @access public */ public function removeListener(PHPUnit_Framework_TestListener $listener) { - for ($i = 0; $i < sizeof($this->fListeners); $i++) { - if ($this->fListeners[$i] === $listener) { - unset($this->fListeners[$i]); + for ($i = 0; $i < sizeof($this->listeners); $i++) { + if ($this->listeners[$i] === $listener) { + unset($this->listeners[$i]); } } } @@ -254,7 +254,7 @@ * @access public */ public function runCount() { - return $this->fRunTests; + return $this->runTests; } // }}} @@ -266,7 +266,7 @@ * @access public */ public function shouldStop() { - return $this->fStop; + return $this->stop; } // }}} @@ -279,9 +279,9 @@ * @access public */ public function startTest(PHPUnit_Framework_Test $test) { - $this->fRunTests += $test->countTestCases(); + $this->runTests += $test->countTestCases(); - foreach ($this->fListeners as $listener) { + foreach ($this->listeners as $listener) { $listener->startTest($test); } } @@ -295,7 +295,7 @@ * @access public */ public function stop() { - $this->fStop = true; + $this->stop = true; } // }}} @@ -308,7 +308,7 @@ * @access public */ public function wasSuccessful() { - if (empty($this->fErrors) && empty($this->fFailures)) { + if (empty($this->errors) && empty($this->failures)) { return true; } else { return false; Index: pear/PHPUnit/Framework/TestSuite.php diff -u pear/PHPUnit/Framework/TestSuite.php:1.13 pear/PHPUnit/Framework/TestSuite.php:1.14 --- pear/PHPUnit/Framework/TestSuite.php:1.13 Thu Jan 1 05:31:42 2004 +++ pear/PHPUnit/Framework/TestSuite.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestSuite.php,v 1.13 2004/01/01 10:31:42 sebastian Exp $ +// $Id: TestSuite.php,v 1.14 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/Test.php'; @@ -48,7 +48,7 @@ * @var string * @access private */ - private $fName = ''; + private $name = ''; /** * The tests in the test suite. @@ -56,7 +56,7 @@ * @var array * @access private */ - private $fTests = array(); + private $tests = array(); // }}} // {{{ public function __construct($theClass = '', $name = '') @@ -99,7 +99,7 @@ $this->addTestMethod($method, $names, $theClass); } - if (empty($this->fTests)) { + if (empty($this->tests)) { $this->addTest( self::warning( sprintf( @@ -135,7 +135,7 @@ * @access public */ public function addTest($test) { - $this->fTests[] = $test; + $this->tests[] = $test; } // }}} @@ -171,7 +171,7 @@ public function countTestCases() { $count = 0; - foreach ($this->fTests as $test) { + foreach ($this->tests as $test) { $count += $test->countTestCases(); } @@ -216,7 +216,7 @@ * @access public */ public function getName() { - return $this->fName; + return $this->name; } // }}} @@ -229,7 +229,7 @@ * @access public */ public function run(PHPUnit_Framework_TestResult $result) { - foreach ($this->fTests as $test) { + foreach ($this->tests as $test) { if ($result->shouldStop()) { break; } @@ -262,7 +262,7 @@ * @access public */ public function setName($name) { - $this->fName = $name; + $this->name = $name; } // }}} @@ -276,8 +276,8 @@ * @access public */ public function testAt($index) { - if (isset($this->fTests[$index])) { - return $this->fTests[$index]; + if (isset($this->tests[$index])) { + return $this->tests[$index]; } else { return false; } @@ -293,7 +293,7 @@ * @access public */ public function testCount() { - return sizeof($this->fTests); + return sizeof($this->tests); } // }}} @@ -306,7 +306,7 @@ * @access public */ public function tests() { - return $this->fTests; + return $this->tests; } // }}} Index: pear/PHPUnit/Tests/WasRun.php diff -u pear/PHPUnit/Tests/WasRun.php:1.3 pear/PHPUnit/Tests/WasRun.php:1.4 --- pear/PHPUnit/Tests/WasRun.php:1.3 Thu Jan 1 05:31:43 2004 +++ pear/PHPUnit/Tests/WasRun.php Sun Jan 4 05:25:10 2004 @@ -12,16 +12,16 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: WasRun.php,v 1.3 2004/01/01 10:31:43 sebastian Exp $ +// $Id: WasRun.php,v 1.4 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; class PHPUnit_Tests_WasRun extends PHPUnit_Framework_TestCase { - public $fWasRun = false; + public $wasRun = false; protected function runTest() { - $this->fWasRun = true; + $this->wasRun = true; } } Index: pear/PHPUnit/Tests/Framework/DoubleTestCase.php diff -u pear/PHPUnit/Tests/Framework/DoubleTestCase.php:1.3 pear/PHPUnit/Tests/Framework/DoubleTestCase.php:1.4 --- pear/PHPUnit/Tests/Framework/DoubleTestCase.php:1.3 Thu Jan 1 05:31:45 2004 +++ pear/PHPUnit/Tests/Framework/DoubleTestCase.php Sun Jan 4 05:25:11 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: DoubleTestCase.php,v 1.3 2004/01/01 10:31:45 sebastian Exp $ +// $Id: DoubleTestCase.php,v 1.4 2004/01/04 10:25:11 sebastian Exp $ // require_once 'PHPUnit/Framework/Test.php'; @@ -20,10 +20,10 @@ require_once 'PHPUnit/Framework/TestResult.php'; class PHPUnit_Tests_Framework_DoubleTestCase implements PHPUnit_Framework_Test { - private $fTestCase; + private $testCase; public function __construct(PHPUnit_Framework_TestCase $testCase) { - $this->fTestCase = $testCase; + $this->testCase = $testCase; } public function countTestCases() { @@ -33,8 +33,8 @@ public function run(PHPUnit_Framework_TestResult $result) { $result->startTest($this); - $this->fTestCase->runBare(); - $this->fTestCase->runBare(); + $this->testCase->runBare(); + $this->testCase->runBare(); $result->endTest($this); } Index: pear/PHPUnit/Tests/Framework/SuiteTest.php diff -u pear/PHPUnit/Tests/Framework/SuiteTest.php:1.3 pear/PHPUnit/Tests/Framework/SuiteTest.php:1.4 --- pear/PHPUnit/Tests/Framework/SuiteTest.php:1.3 Thu Jan 1 05:31:45 2004 +++ pear/PHPUnit/Tests/Framework/SuiteTest.php Sun Jan 4 05:25:11 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: SuiteTest.php,v 1.3 2004/01/01 10:31:45 sebastian Exp $ +// $Id: SuiteTest.php,v 1.4 2004/01/04 10:25:11 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; @@ -27,10 +27,10 @@ require_once 'PHPUnit/Tests/Framework/OneTestCase.php'; class PHPUnit_Tests_Framework_SuiteTest extends PHPUnit_Framework_TestCase { - protected $fResult; + protected $result; protected function setUp() { - $this->fResult = new PHPUnit_Framework_TestResult; + $this->result = new PHPUnit_Framework_TestResult; } public static function suite() { Index: pear/PHPUnit/Tests/Framework/TestImplementorTest.php diff -u pear/PHPUnit/Tests/Framework/TestImplementorTest.php:1.3 pear/PHPUnit/Tests/Framework/TestImplementorTest.php:1.4 --- pear/PHPUnit/Tests/Framework/TestImplementorTest.php:1.3 Thu Jan 1 05:31:45 2004 +++ pear/PHPUnit/Tests/Framework/TestImplementorTest.php Sun Jan 4 05:25:11 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestImplementorTest.php,v 1.3 2004/01/01 10:31:45 sebastian Exp $ +// $Id: TestImplementorTest.php,v 1.4 2004/01/04 10:25:11 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; @@ -22,10 +22,10 @@ require_once 'PHPUnit/Tests/Framework/Success.php'; class PHPUnit_Tests_Framework_TestImplementorTest extends PHPUnit_Framework_TestCase { - private $fTest; + private $test; public function __construct() { - $this->fTest = new PHPUnit_Tests_Framework_DoubleTestCase( + $this->test = new PHPUnit_Tests_Framework_DoubleTestCase( new PHPUnit_Tests_Framework_Success ); } @@ -33,9 +33,9 @@ public function testSuccessfulRun() { $result = new PHPUnit_Framework_TestResult; - $this->fTest->run($result); + $this->test->run($result); - $this->assertEquals($this->fTest->countTestCases(), $result->runCount()); + $this->assertEquals($this->test->countTestCases(), $result->runCount()); $this->assertEquals(0, $result->errorCount()); $this->assertEquals(0, $result->failureCount()); } Index: pear/PHPUnit/Tests/Framework/TestListenerTest.php diff -u pear/PHPUnit/Tests/Framework/TestListenerTest.php:1.3 pear/PHPUnit/Tests/Framework/TestListenerTest.php:1.4 --- pear/PHPUnit/Tests/Framework/TestListenerTest.php:1.3 Thu Jan 1 05:31:45 2004 +++ pear/PHPUnit/Tests/Framework/TestListenerTest.php Sun Jan 4 05:25:11 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestListenerTest.php,v 1.3 2004/01/01 10:31:45 sebastian Exp $ +// $Id: TestListenerTest.php,v 1.4 2004/01/04 10:25:11 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; @@ -24,59 +24,59 @@ require_once 'PHPUnit/Tests/Framework/Success.php'; class PHPUnit_Tests_Framework_TestListenerTest extends PHPUnit_Framework_TestCase implements PHPUnit_Framework_TestListener { - private $fResult; - private $fStartCount; - private $fEndCount; - private $fFailureCount; - private $fErrorCount; + private $result; + private $startCount; + private $endCount; + private $failureCount; + private $errorCount; public function addError(PHPUnit_Framework_Test $test, Exception $e) { - $this->fErrorCount++; + $this->errorCount++; } public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e) { - $this->fFailureCount++; + $this->failureCount++; } public function endTest(PHPUnit_Framework_Test $test) { - $this->fEndCount++; + $this->endCount++; } public function startTest(PHPUnit_Framework_Test $test) { - $this->fStartCount++; + $this->startCount++; } protected function setUp() { - $this->fResult = new PHPUnit_Framework_TestResult; - $this->fResult->addListener($this); + $this->result = new PHPUnit_Framework_TestResult; + $this->result->addListener($this); - $this->fFailureCount = 0; - $this->fEndCount = 0; - $this->fStartCount = 0; + $this->failureCount = 0; + $this->endCount = 0; + $this->startCount = 0; } public function testError() { $test = new PHPUnit_Tests_Framework_Error; - $test->run($this->fResult); + $test->run($this->result); - $this->assertEquals(1, $this->fErrorCount); - $this->assertEquals(1, $this->fEndCount); + $this->assertEquals(1, $this->errorCount); + $this->assertEquals(1, $this->endCount); } public function testFailure() { $test = new PHPUnit_Tests_Framework_Failure; - $test->run($this->fResult); + $test->run($this->result); - $this->assertEquals(1, $this->fFailureCount); - $this->assertEquals(1, $this->fEndCount); + $this->assertEquals(1, $this->failureCount); + $this->assertEquals(1, $this->endCount); } public function testStartStop() { $test = new PHPUnit_Tests_Framework_Success; - $test->run($this->fResult); + $test->run($this->result); - $this->assertEquals(1, $this->fStartCount); - $this->assertEquals(1, $this->fEndCount); + $this->assertEquals(1, $this->startCount); + $this->assertEquals(1, $this->endCount); } } Index: pear/PHPUnit/TextUI/ResultPrinter.php diff -u pear/PHPUnit/TextUI/ResultPrinter.php:1.16 pear/PHPUnit/TextUI/ResultPrinter.php:1.17 --- pear/PHPUnit/TextUI/ResultPrinter.php:1.16 Thu Jan 1 05:31:47 2004 +++ pear/PHPUnit/TextUI/ResultPrinter.php Sun Jan 4 05:25:12 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: ResultPrinter.php,v 1.16 2004/01/01 10:31:47 sebastian Exp $ +// $Id: ResultPrinter.php,v 1.17 2004/01/04 10:25:12 sebastian Exp $ // require_once 'PHPUnit/Framework/TestFailure.php'; @@ -31,7 +31,7 @@ * @var integer * @access private */ - private $fColumn = 0; + private $column = 0; /** * @var resource @@ -304,8 +304,8 @@ public function startTest(PHPUnit_Framework_Test $test) { $this->write('.'); - if ($this->fColumn++ >= 40) { - $this->fColumn = 0; + if ($this->column++ >= 40) { + $this->column = 0; $this->write("\n"); } } Index: pear/PHPUnit/TextUI/TestRunner.php diff -u pear/PHPUnit/TextUI/TestRunner.php:1.6 pear/PHPUnit/TextUI/TestRunner.php:1.7 --- pear/PHPUnit/TextUI/TestRunner.php:1.6 Thu Jan 1 05:31:47 2004 +++ pear/PHPUnit/TextUI/TestRunner.php Sun Jan 4 05:25:12 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestRunner.php,v 1.6 2004/01/01 10:31:47 sebastian Exp $ +// $Id: TestRunner.php,v 1.7 2004/01/04 10:25:12 sebastian Exp $ // if (!defined('PHPUnit_MAIN_METHOD')) { @@ -42,7 +42,7 @@ * @var PHPUnit_TextUI_ResultPrinter * @access private */ - private $fPrinter; + private $printer; // }}} // {{{ public function __construct($resultPrinter = null) @@ -52,7 +52,7 @@ $resultPrinter = new PHPUnit_TextUI_ResultPrinter; } - $this->fPrinter = $resultPrinter; + $this->printer = $resultPrinter; } // }}} @@ -78,7 +78,7 @@ // {{{ protected function start($arguments) protected function start($arguments) { - $this->fPrinter->write( + $this->printer->write( sprintf( "PHPUnit %s by Sebastian Bergmann.\n\n", @@ -159,7 +159,7 @@ public function doRun(PHPUnit_Framework_Test $suite, $wait = false) { $result = $this->createTestResult(); - $result->addListener($this->fPrinter); + $result->addListener($this->printer); $timer = new Benchmark_Timer; $timer->start(); @@ -167,7 +167,7 @@ $timer->stop(); $this->pause($wait); - $this->fPrinter->printResult($result, $timer->timeElapsed()); + $this->printer->printResult($result, $timer->timeElapsed()); return $result; } @@ -184,7 +184,7 @@ return; } - $this->fPrinter->printWaitPrompt(); + $this->printer->printWaitPrompt(); fgets(STDIN); } @@ -249,7 +249,7 @@ // {{{ public function setPrinter(PHPUnit_TextUI_ResultPrinter $resultPrinter) public function setPrinter(PHPUnit_TextUI_ResultPrinter $resultPrinter) { - $this->fPrinter = $resultPrinter; + $this->printer = $resultPrinter; } // }}}
Index: pear/PHPUnit/Extensions/ExceptionTestCase.php diff -u pear/PHPUnit/Extensions/ExceptionTestCase.php:1.4 pear/PHPUnit/Extensions/ExceptionTestCase.php:1.5 --- pear/PHPUnit/Extensions/ExceptionTestCase.php:1.4 Thu Jan 1 05:31:40 2004 +++ pear/PHPUnit/Extensions/ExceptionTestCase.php Sun Jan 4 05:25:09 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: ExceptionTestCase.php,v 1.4 2004/01/01 10:31:40 sebastian Exp $ +// $Id: ExceptionTestCase.php,v 1.5 2004/01/04 10:25:09 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; @@ -33,7 +33,7 @@ * @var string * @access private */ - private $fExpected = ''; + private $expected = ''; // }}} // {{{ public function __construct($name, $exception) @@ -45,7 +45,7 @@ */ public function __construct($name, $exception) { parent::__construct($name); - $this->fExpected = $exception; + $this->expected = $exception; } // }}} @@ -60,14 +60,14 @@ } catch (Exception $e) { - if (is_a($e, $this->fExpected)) { + if (is_a($e, $this->expected)) { return; } else { throw $e; } } - $this->fail('Expected exception ' . $this->fExpected); + $this->fail('Expected exception ' . $this->expected); } // }}} Index: pear/PHPUnit/Extensions/PerformanceTestCase.php diff -u pear/PHPUnit/Extensions/PerformanceTestCase.php:1.4 pear/PHPUnit/Extensions/PerformanceTestCase.php:1.5 --- pear/PHPUnit/Extensions/PerformanceTestCase.php:1.4 Thu Jan 1 05:31:40 2004 +++ pear/PHPUnit/Extensions/PerformanceTestCase.php Sun Jan 4 05:25:09 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: PerformanceTestCase.php,v 1.4 2004/01/01 10:31:40 sebastian Exp $ +// $Id: PerformanceTestCase.php,v 1.5 2004/01/04 10:25:09 sebastian Exp $ // require_once 'Benchmark/Timer.php'; @@ -33,7 +33,7 @@ * @var double * @access private */ - private $fMaxRunningTime = 0; + private $maxRunningTime = 0; // }}} // {{{ public function __construct($name, $maxRunningTime = 0) @@ -45,7 +45,7 @@ */ public function __construct($name, $maxRunningTime = 0) { parent::__construct($name); - $this->fMaxRunningTime = $maxRunningTime; + $this->maxRunningTime = $maxRunningTime; } // }}} @@ -61,13 +61,13 @@ parent::runTest(); $timer->stop(); - if ($this->fMaxRunningTime != 0 && - $timer->timeElapsed() > $this->fMaxRunningTime) { + if ($this->maxRunningTime != 0 && + $timer->timeElapsed() > $this->maxRunningTime) { PHPUnit_Framework_Assert::fail( sprintf( 'expected running time: <= %s but was: %s', - $this->fMaxRunningTime, + $this->maxRunningTime, $timer->timeElapsed() ) ); Index: pear/PHPUnit/Framework/ComparisonFailure.php diff -u pear/PHPUnit/Framework/ComparisonFailure.php:1.7 pear/PHPUnit/Framework/ComparisonFailure.php:1.8 --- pear/PHPUnit/Framework/ComparisonFailure.php:1.7 Thu Jan 1 05:31:42 2004 +++ pear/PHPUnit/Framework/ComparisonFailure.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: ComparisonFailure.php,v 1.7 2004/01/01 10:31:42 sebastian Exp $ +// $Id: ComparisonFailure.php,v 1.8 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/AssertionFailedError.php'; @@ -30,13 +30,13 @@ * @var string * @access private */ - private $fExpected = ''; + private $expected = ''; /** * @var string * @access private */ - private $fActual = ''; + private $actual = ''; // }}} // {{{ public function __construct($expected, $actual, $message = '') @@ -52,8 +52,8 @@ public function __construct($expected, $actual, $message = '') { parent::__construct($message); - $this->fExpected = $expected; - $this->fActual = $actual; + $this->expected = $expected; + $this->actual = $actual; } // }}} @@ -67,48 +67,48 @@ * @access public */ public function toString() { - if ($this->fExpected == null && $this->fActual == null) { + if ($this->expected == null && $this->actual == null) { return PHPUnit_Framework_Assert::format( - $this->fExpected, - $this->fActual, + $this->expected, + $this->actual, parent::getMessage() ); } - $end = min(strlen($this->fExpected), strlen($this->fActual)); + $end = min(strlen($this->expected), strlen($this->actual)); $i = 0; - $j = strlen($this->fExpected) - 1; - $k = strlen($this->fActual) - 1; + $j = strlen($this->expected) - 1; + $k = strlen($this->actual) - 1; for (; $i < $end; $i++) { - if ($this->fExpected[$i] != $this->fActual[$i]) { + if ($this->expected[$i] != $this->actual[$i]) { break; } } for (; $k >= $i && $j >= $i; $k--,$j--) { - if ($this->fExpected[$j] != $this->fActual[$k]) { + if ($this->expected[$j] != $this->actual[$k]) { break; } } if ($j < $i && $k < $i) { - $expected = $this->fExpected; - $actual = $this->fActual; + $expected = $this->expected; + $actual = $this->actual; } else { - $expected = substr($this->fExpected, $i, ($j + 1 - $i)); - $actual = substr($this->fActual, $i, ($k + 1 - $i));; + $expected = substr($this->expected, $i, ($j + 1 - $i)); + $actual = substr($this->actual, $i, ($k + 1 - $i));; if ($i <= $end && $i > 0) { $expected = '...' . $expected; $actual = '...' . $actual; } - if ($j < strlen($this->fExpected) - 1) { + if ($j < strlen($this->expected) - 1) { $expected .= '...'; } - if ($k < strlen($this->fActual) - 1) { + if ($k < strlen($this->actual) - 1) { $actual .= '...'; } Index: pear/PHPUnit/Framework/TestCase.php diff -u pear/PHPUnit/Framework/TestCase.php:1.15 pear/PHPUnit/Framework/TestCase.php:1.16 --- pear/PHPUnit/Framework/TestCase.php:1.15 Sat Jan 3 12:28:10 2004 +++ pear/PHPUnit/Framework/TestCase.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestCase.php,v 1.15 2004/01/03 17:28:10 sebastian Exp $ +// $Id: TestCase.php,v 1.16 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/Assert.php'; @@ -36,16 +36,16 @@ * Here is an example: * * class MathTest extends PHPUnit_Framework_TestCase { - * public $fValue1; - * public $fValue2; + * public $value1; + * public $value2; * * public function __construct($name) { * parent::__construct($name); * } * * public function setUp() { - * $this->fValue1 = 2; - * $this->fValue2 = 3; + * $this->value1 = 2; + * $this->value2 = 3; * } * } * @@ -54,7 +54,7 @@ * assert with a boolean. * * public function testPass() { - * $this->assertTrue($this->fValue1 + $this->fValue2 == 5); + * $this->assertTrue($this->value1 + $this->value2 == 5); * } * * @abstract @@ -78,7 +78,7 @@ * @var string * @access private */ - private $fName = null; + private $name = null; // }}} // {{{ public function __construct($name = false) @@ -151,7 +151,7 @@ * @access public */ public function getName() { - return $this->fName; + return $this->name; } // }}} @@ -206,11 +206,11 @@ * @access protected */ protected function runTest() { - self::assertNotNull($this->fName); + self::assertNotNull($this->name); try { $class = new Reflection_Class($this); - $method = $class->getMethod($this->fName); + $method = $class->getMethod($this->name); } catch (Exception $e) { @@ -242,7 +242,7 @@ * @access public */ public function setName($name) { - $this->fName = $name; + $this->name = $name; } // }}} Index: pear/PHPUnit/Framework/TestFailure.php diff -u pear/PHPUnit/Framework/TestFailure.php:1.6 pear/PHPUnit/Framework/TestFailure.php:1.7 --- pear/PHPUnit/Framework/TestFailure.php:1.6 Thu Jan 1 05:31:42 2004 +++ pear/PHPUnit/Framework/TestFailure.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestFailure.php,v 1.6 2004/01/01 10:31:42 sebastian Exp $ +// $Id: TestFailure.php,v 1.7 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/Test.php'; @@ -30,13 +30,13 @@ * @var PHPUnit_Framework_Test * @access protected */ - protected $fFailedTest; + protected $failedTest; /** * @var Exception * @access protected */ - protected $fThrownException; + protected $thrownException; // }}} // {{{ public function __construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException) @@ -49,8 +49,8 @@ * @access public */ public function __construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException) { - $this->fFailedTest = $failedTest; - $this->fThrownException = $thrownException; + $this->failedTest = $failedTest; + $this->thrownException = $thrownException; } // }}} @@ -66,8 +66,8 @@ return sprintf( '%s: %s', - $this->fFailedTest, - $this->fThrownException->getMessage() + $this->failedTest, + $this->thrownException->getMessage() ); } @@ -81,7 +81,7 @@ * @access public */ public function failedTest() { - return $this->fFailedTest; + return $this->failedTest; } // }}} @@ -94,7 +94,7 @@ * @access public */ public function thrownException() { - return $this->fThrownException; + return $this->thrownException; } // }}} Index: pear/PHPUnit/Framework/TestResult.php diff -u pear/PHPUnit/Framework/TestResult.php:1.7 pear/PHPUnit/Framework/TestResult.php:1.8 --- pear/PHPUnit/Framework/TestResult.php:1.7 Sat Jan 3 12:28:10 2004 +++ pear/PHPUnit/Framework/TestResult.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestResult.php,v 1.7 2004/01/03 17:28:10 sebastian Exp $ +// $Id: TestResult.php,v 1.8 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/AssertionFailedError.php'; @@ -33,31 +33,31 @@ * @var array * @access protected */ - protected $fErrors = array(); + protected $errors = array(); /** * @var array * @access protected */ - protected $fFailures = array(); + protected $failures = array(); /** * @var array * @access protected */ - protected $fListeners = array(); + protected $listeners = array(); /** * @var integer * @access protected */ - protected $fRunTests = 0; + protected $runTests = 0; /** * @var boolean * @access private */ - private $fStop = false; + private $stop = false; /** * Code Coverage information provided by Xdebug. @@ -79,9 +79,9 @@ * @access public */ public function addError(PHPUnit_Framework_Test $test, Exception $e) { - $this->fErrors[] = new PHPUnit_Framework_TestFailure($test, $e); + $this->errors[] = new PHPUnit_Framework_TestFailure($test, $e); - foreach ($this->fListeners as $listener) { + foreach ($this->listeners as $listener) { $listener->addError($test, $e); } } @@ -98,9 +98,9 @@ * @access public */ public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e) { - $this->fFailures[] = new PHPUnit_Framework_TestFailure($test, $e); + $this->failures[] = new PHPUnit_Framework_TestFailure($test, $e); - foreach ($this->fListeners as $listener) { + foreach ($this->listeners as $listener) { $listener->addFailure($test, $e); } } @@ -115,7 +115,7 @@ * @access public */ public function addListener(PHPUnit_Framework_TestListener $listener) { - $this->fListeners[] = $listener; + $this->listeners[] = $listener; } // }}} @@ -130,7 +130,7 @@ public function endTest(PHPUnit_Framework_Test $test) { $this->codeCoverageInformation[$test->getName()] = $test->getCodeCoverageInformation(); - foreach ($this->fListeners as $listener) { + foreach ($this->listeners as $listener) { $listener->endTest($test); } } @@ -145,7 +145,7 @@ * @access public */ public function errorCount() { - return sizeof($this->fErrors); + return sizeof($this->errors); } // }}} @@ -158,7 +158,7 @@ * @access public */ public function errors() { - return $this->fErrors; + return $this->errors; } // }}} @@ -171,7 +171,7 @@ * @access public */ public function failureCount() { - return sizeof($this->fFailures); + return sizeof($this->failures); } // }}} @@ -184,7 +184,7 @@ * @access public */ public function failures() { - return $this->fFailures; + return $this->failures; } // }}} @@ -210,9 +210,9 @@ * @access public */ public function removeListener(PHPUnit_Framework_TestListener $listener) { - for ($i = 0; $i < sizeof($this->fListeners); $i++) { - if ($this->fListeners[$i] === $listener) { - unset($this->fListeners[$i]); + for ($i = 0; $i < sizeof($this->listeners); $i++) { + if ($this->listeners[$i] === $listener) { + unset($this->listeners[$i]); } } } @@ -254,7 +254,7 @@ * @access public */ public function runCount() { - return $this->fRunTests; + return $this->runTests; } // }}} @@ -266,7 +266,7 @@ * @access public */ public function shouldStop() { - return $this->fStop; + return $this->stop; } // }}} @@ -279,9 +279,9 @@ * @access public */ public function startTest(PHPUnit_Framework_Test $test) { - $this->fRunTests += $test->countTestCases(); + $this->runTests += $test->countTestCases(); - foreach ($this->fListeners as $listener) { + foreach ($this->listeners as $listener) { $listener->startTest($test); } } @@ -295,7 +295,7 @@ * @access public */ public function stop() { - $this->fStop = true; + $this->stop = true; } // }}} @@ -308,7 +308,7 @@ * @access public */ public function wasSuccessful() { - if (empty($this->fErrors) && empty($this->fFailures)) { + if (empty($this->errors) && empty($this->failures)) { return true; } else { return false; Index: pear/PHPUnit/Framework/TestSuite.php diff -u pear/PHPUnit/Framework/TestSuite.php:1.13 pear/PHPUnit/Framework/TestSuite.php:1.14 --- pear/PHPUnit/Framework/TestSuite.php:1.13 Thu Jan 1 05:31:42 2004 +++ pear/PHPUnit/Framework/TestSuite.php Sun Jan 4 05:25:10 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestSuite.php,v 1.13 2004/01/01 10:31:42 sebastian Exp $ +// $Id: TestSuite.php,v 1.14 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/Test.php'; @@ -48,7 +48,7 @@ * @var string * @access private */ - private $fName = ''; + private $name = ''; /** * The tests in the test suite. @@ -56,7 +56,7 @@ * @var array * @access private */ - private $fTests = array(); + private $tests = array(); // }}} // {{{ public function __construct($theClass = '', $name = '') @@ -99,7 +99,7 @@ $this->addTestMethod($method, $names, $theClass); } - if (empty($this->fTests)) { + if (empty($this->tests)) { $this->addTest( self::warning( sprintf( @@ -135,7 +135,7 @@ * @access public */ public function addTest($test) { - $this->fTests[] = $test; + $this->tests[] = $test; } // }}} @@ -171,7 +171,7 @@ public function countTestCases() { $count = 0; - foreach ($this->fTests as $test) { + foreach ($this->tests as $test) { $count += $test->countTestCases(); } @@ -216,7 +216,7 @@ * @access public */ public function getName() { - return $this->fName; + return $this->name; } // }}} @@ -229,7 +229,7 @@ * @access public */ public function run(PHPUnit_Framework_TestResult $result) { - foreach ($this->fTests as $test) { + foreach ($this->tests as $test) { if ($result->shouldStop()) { break; } @@ -262,7 +262,7 @@ * @access public */ public function setName($name) { - $this->fName = $name; + $this->name = $name; } // }}} @@ -276,8 +276,8 @@ * @access public */ public function testAt($index) { - if (isset($this->fTests[$index])) { - return $this->fTests[$index]; + if (isset($this->tests[$index])) { + return $this->tests[$index]; } else { return false; } @@ -293,7 +293,7 @@ * @access public */ public function testCount() { - return sizeof($this->fTests); + return sizeof($this->tests); } // }}} @@ -306,7 +306,7 @@ * @access public */ public function tests() { - return $this->fTests; + return $this->tests; } // }}} Index: pear/PHPUnit/Tests/WasRun.php diff -u pear/PHPUnit/Tests/WasRun.php:1.3 pear/PHPUnit/Tests/WasRun.php:1.4 --- pear/PHPUnit/Tests/WasRun.php:1.3 Thu Jan 1 05:31:43 2004 +++ pear/PHPUnit/Tests/WasRun.php Sun Jan 4 05:25:10 2004 @@ -12,16 +12,16 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: WasRun.php,v 1.3 2004/01/01 10:31:43 sebastian Exp $ +// $Id: WasRun.php,v 1.4 2004/01/04 10:25:10 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; class PHPUnit_Tests_WasRun extends PHPUnit_Framework_TestCase { - public $fWasRun = false; + public $wasRun = false; protected function runTest() { - $this->fWasRun = true; + $this->wasRun = true; } } Index: pear/PHPUnit/Tests/Framework/DoubleTestCase.php diff -u pear/PHPUnit/Tests/Framework/DoubleTestCase.php:1.3 pear/PHPUnit/Tests/Framework/DoubleTestCase.php:1.4 --- pear/PHPUnit/Tests/Framework/DoubleTestCase.php:1.3 Thu Jan 1 05:31:45 2004 +++ pear/PHPUnit/Tests/Framework/DoubleTestCase.php Sun Jan 4 05:25:11 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: DoubleTestCase.php,v 1.3 2004/01/01 10:31:45 sebastian Exp $ +// $Id: DoubleTestCase.php,v 1.4 2004/01/04 10:25:11 sebastian Exp $ // require_once 'PHPUnit/Framework/Test.php'; @@ -20,10 +20,10 @@ require_once 'PHPUnit/Framework/TestResult.php'; class PHPUnit_Tests_Framework_DoubleTestCase implements PHPUnit_Framework_Test { - private $fTestCase; + private $testCase; public function __construct(PHPUnit_Framework_TestCase $testCase) { - $this->fTestCase = $testCase; + $this->testCase = $testCase; } public function countTestCases() { @@ -33,8 +33,8 @@ public function run(PHPUnit_Framework_TestResult $result) { $result->startTest($this); - $this->fTestCase->runBare(); - $this->fTestCase->runBare(); + $this->testCase->runBare(); + $this->testCase->runBare(); $result->endTest($this); } Index: pear/PHPUnit/Tests/Framework/SuiteTest.php diff -u pear/PHPUnit/Tests/Framework/SuiteTest.php:1.3 pear/PHPUnit/Tests/Framework/SuiteTest.php:1.4 --- pear/PHPUnit/Tests/Framework/SuiteTest.php:1.3 Thu Jan 1 05:31:45 2004 +++ pear/PHPUnit/Tests/Framework/SuiteTest.php Sun Jan 4 05:25:11 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: SuiteTest.php,v 1.3 2004/01/01 10:31:45 sebastian Exp $ +// $Id: SuiteTest.php,v 1.4 2004/01/04 10:25:11 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; @@ -27,10 +27,10 @@ require_once 'PHPUnit/Tests/Framework/OneTestCase.php'; class PHPUnit_Tests_Framework_SuiteTest extends PHPUnit_Framework_TestCase { - protected $fResult; + protected $result; protected function setUp() { - $this->fResult = new PHPUnit_Framework_TestResult; + $this->result = new PHPUnit_Framework_TestResult; } public static function suite() { Index: pear/PHPUnit/Tests/Framework/TestImplementorTest.php diff -u pear/PHPUnit/Tests/Framework/TestImplementorTest.php:1.3 pear/PHPUnit/Tests/Framework/TestImplementorTest.php:1.4 --- pear/PHPUnit/Tests/Framework/TestImplementorTest.php:1.3 Thu Jan 1 05:31:45 2004 +++ pear/PHPUnit/Tests/Framework/TestImplementorTest.php Sun Jan 4 05:25:11 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestImplementorTest.php,v 1.3 2004/01/01 10:31:45 sebastian Exp $ +// $Id: TestImplementorTest.php,v 1.4 2004/01/04 10:25:11 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; @@ -22,10 +22,10 @@ require_once 'PHPUnit/Tests/Framework/Success.php'; class PHPUnit_Tests_Framework_TestImplementorTest extends PHPUnit_Framework_TestCase { - private $fTest; + private $test; public function __construct() { - $this->fTest = new PHPUnit_Tests_Framework_DoubleTestCase( + $this->test = new PHPUnit_Tests_Framework_DoubleTestCase( new PHPUnit_Tests_Framework_Success ); } @@ -33,9 +33,9 @@ public function testSuccessfulRun() { $result = new PHPUnit_Framework_TestResult; - $this->fTest->run($result); + $this->test->run($result); - $this->assertEquals($this->fTest->countTestCases(), $result->runCount()); + $this->assertEquals($this->test->countTestCases(), $result->runCount()); $this->assertEquals(0, $result->errorCount()); $this->assertEquals(0, $result->failureCount()); } Index: pear/PHPUnit/Tests/Framework/TestListenerTest.php diff -u pear/PHPUnit/Tests/Framework/TestListenerTest.php:1.3 pear/PHPUnit/Tests/Framework/TestListenerTest.php:1.4 --- pear/PHPUnit/Tests/Framework/TestListenerTest.php:1.3 Thu Jan 1 05:31:45 2004 +++ pear/PHPUnit/Tests/Framework/TestListenerTest.php Sun Jan 4 05:25:11 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestListenerTest.php,v 1.3 2004/01/01 10:31:45 sebastian Exp $ +// $Id: TestListenerTest.php,v 1.4 2004/01/04 10:25:11 sebastian Exp $ // require_once 'PHPUnit/Framework/TestCase.php'; @@ -24,59 +24,59 @@ require_once 'PHPUnit/Tests/Framework/Success.php'; class PHPUnit_Tests_Framework_TestListenerTest extends PHPUnit_Framework_TestCase implements PHPUnit_Framework_TestListener { - private $fResult; - private $fStartCount; - private $fEndCount; - private $fFailureCount; - private $fErrorCount; + private $result; + private $startCount; + private $endCount; + private $failureCount; + private $errorCount; public function addError(PHPUnit_Framework_Test $test, Exception $e) { - $this->fErrorCount++; + $this->errorCount++; } public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e) { - $this->fFailureCount++; + $this->failureCount++; } public function endTest(PHPUnit_Framework_Test $test) { - $this->fEndCount++; + $this->endCount++; } public function startTest(PHPUnit_Framework_Test $test) { - $this->fStartCount++; + $this->startCount++; } protected function setUp() { - $this->fResult = new PHPUnit_Framework_TestResult; - $this->fResult->addListener($this); + $this->result = new PHPUnit_Framework_TestResult; + $this->result->addListener($this); - $this->fFailureCount = 0; - $this->fEndCount = 0; - $this->fStartCount = 0; + $this->failureCount = 0; + $this->endCount = 0; + $this->startCount = 0; } public function testError() { $test = new PHPUnit_Tests_Framework_Error; - $test->run($this->fResult); + $test->run($this->result); - $this->assertEquals(1, $this->fErrorCount); - $this->assertEquals(1, $this->fEndCount); + $this->assertEquals(1, $this->errorCount); + $this->assertEquals(1, $this->endCount); } public function testFailure() { $test = new PHPUnit_Tests_Framework_Failure; - $test->run($this->fResult); + $test->run($this->result); - $this->assertEquals(1, $this->fFailureCount); - $this->assertEquals(1, $this->fEndCount); + $this->assertEquals(1, $this->failureCount); + $this->assertEquals(1, $this->endCount); } public function testStartStop() { $test = new PHPUnit_Tests_Framework_Success; - $test->run($this->fResult); + $test->run($this->result); - $this->assertEquals(1, $this->fStartCount); - $this->assertEquals(1, $this->fEndCount); + $this->assertEquals(1, $this->startCount); + $this->assertEquals(1, $this->endCount); } } Index: pear/PHPUnit/TextUI/ResultPrinter.php diff -u pear/PHPUnit/TextUI/ResultPrinter.php:1.16 pear/PHPUnit/TextUI/ResultPrinter.php:1.17 --- pear/PHPUnit/TextUI/ResultPrinter.php:1.16 Thu Jan 1 05:31:47 2004 +++ pear/PHPUnit/TextUI/ResultPrinter.php Sun Jan 4 05:25:12 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: ResultPrinter.php,v 1.16 2004/01/01 10:31:47 sebastian Exp $ +// $Id: ResultPrinter.php,v 1.17 2004/01/04 10:25:12 sebastian Exp $ // require_once 'PHPUnit/Framework/TestFailure.php'; @@ -31,7 +31,7 @@ * @var integer * @access private */ - private $fColumn = 0; + private $column = 0; /** * @var resource @@ -304,8 +304,8 @@ public function startTest(PHPUnit_Framework_Test $test) { $this->write('.'); - if ($this->fColumn++ >= 40) { - $this->fColumn = 0; + if ($this->column++ >= 40) { + $this->column = 0; $this->write("\n"); } } Index: pear/PHPUnit/TextUI/TestRunner.php diff -u pear/PHPUnit/TextUI/TestRunner.php:1.6 pear/PHPUnit/TextUI/TestRunner.php:1.7 --- pear/PHPUnit/TextUI/TestRunner.php:1.6 Thu Jan 1 05:31:47 2004 +++ pear/PHPUnit/TextUI/TestRunner.php Sun Jan 4 05:25:12 2004 @@ -12,7 +12,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: TestRunner.php,v 1.6 2004/01/01 10:31:47 sebastian Exp $ +// $Id: TestRunner.php,v 1.7 2004/01/04 10:25:12 sebastian Exp $ // if (!defined('PHPUnit_MAIN_METHOD')) { @@ -42,7 +42,7 @@ * @var PHPUnit_TextUI_ResultPrinter * @access private */ - private $fPrinter; + private $printer; // }}} // {{{ public function __construct($resultPrinter = null) @@ -52,7 +52,7 @@ $resultPrinter = new PHPUnit_TextUI_ResultPrinter; } - $this->fPrinter = $resultPrinter; + $this->printer = $resultPrinter; } // }}} @@ -78,7 +78,7 @@ // {{{ protected function start($arguments) protected function start($arguments) { - $this->fPrinter->write( + $this->printer->write( sprintf( "PHPUnit %s by Sebastian Bergmann.\n\n", @@ -159,7 +159,7 @@ public function doRun(PHPUnit_Framework_Test $suite, $wait = false) { $result = $this->createTestResult(); - $result->addListener($this->fPrinter); + $result->addListener($this->printer); $timer = new Benchmark_Timer; $timer->start(); @@ -167,7 +167,7 @@ $timer->stop(); $this->pause($wait); - $this->fPrinter->printResult($result, $timer->timeElapsed()); + $this->printer->printResult($result, $timer->timeElapsed()); return $result; } @@ -184,7 +184,7 @@ return; } - $this->fPrinter->printWaitPrompt(); + $this->printer->printWaitPrompt(); fgets(STDIN); } @@ -249,7 +249,7 @@ // {{{ public function setPrinter(PHPUnit_TextUI_ResultPrinter $resultPrinter) public function setPrinter(PHPUnit_TextUI_ResultPrinter $resultPrinter) { - $this->fPrinter = $resultPrinter; + $this->printer = $resultPrinter; } // }}}