diff options
author | Luke Shepard <lshepard@devrs006.snc1.facebook.com> | 2009-05-27 10:54:14 -0700 |
---|---|---|
committer | Luke Shepard <lshepard@devrs006.snc1.facebook.com> | 2009-05-27 10:54:14 -0700 |
commit | ae52c6b3a3b9741c0ef60b6c91ba27af1d85eab7 (patch) | |
tree | 450c172565fffe576264e64ea83a9c4978709da9 /admin | |
parent | 5a96dc7b3fbd600f5acbbf08cf8d2d131aa7f2d3 (diff) | |
download | php-openid-ae52c6b3a3b9741c0ef60b6c91ba27af1d85eab7.zip php-openid-ae52c6b3a3b9741c0ef60b6c91ba27af1d85eab7.tar.gz php-openid-ae52c6b3a3b9741c0ef60b6c91ba27af1d85eab7.tar.bz2 |
[ Upgrading php-openid test framework to use PHPUnit 3.3 ]
Reviewed By: Will Norris
The set of tests assumes PHPUnit 2.3, which conflicts with my environment setup.
I think PHPUnit 3.3 is pretty widespread now, and under active maintenance
(latest rev 4/10/2009).
There's a few changes included here. I did a few mostly automated code
transformations:
replace "PHPUnit_TestCase" "PHPUnit_Framework_TestCase"
replace "PHPUnit_TestSuite" "PHPUnit_Framework_TestSuite"
removed all require_once "PHPUnit.php" - they are unnecessary.
"call by reference" is now deprecated, so changed "&$" to "$"
I also made a few changes to admin/testtext.php and Tests/TestDriver.php to
accomodate the new syntax.
Note that this just upgrades the framework; it does not guarantee that all tests
pass. I'll submit future diffs to fix or disable failing unit tests. I wasn't
able to get the tests running with the previous version, so I don't know if
these have always been failing.
I doubt that the github has automatically running unit tests, but if so then
we'll have to make sure that the central repo is running the same version of
PHPUnit.
Diffstat (limited to 'admin')
-rw-r--r-- | admin/texttest.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/admin/texttest.php b/admin/texttest.php index b1c0a3c..422dd1d 100644 --- a/admin/texttest.php +++ b/admin/texttest.php @@ -1,19 +1,19 @@ <?php require_once 'Tests/TestDriver.php'; -require_once 'PHPUnit/TestResult.php'; +require_once 'PHPUnit/Framework.php'; require_once 'Console/Getopt.php'; -class TextTestResult extends PHPUnit_TestResult { - function addError(&$test, &$t) +class TextTestResult extends PHPUnit_Framework_TestResult { + function addError(&$test, &$t, $time=0) { - parent::addError($test, $t); + parent::addError($test, $t, $time); echo "E"; } - function addFailure(&$test, &$t) + function addFailure(&$test, &$t, $time=0) { - parent::addFailure($test, $t); + parent::addFailure($test, $t, $time); echo "F"; } @@ -134,7 +134,7 @@ foreach ($extra_test_modules as $filename) { $class_name = "Tests_Auth_OpenID_${module_name}_Test"; $suites[] = makeSuite($class_name); } - + $totals = array( 'run' => 0, @@ -155,7 +155,7 @@ Test suite: $name $suite->run($result); $after = microtime_float(); - $run = $result->runCount(); + $run = $result->count(); $error = $result->errorCount(); $failure = $result->failureCount(); $delta = $after - $before; |