Skip to content

Commit

Permalink
Use PHP_Timer.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed May 8, 2010
1 parent 17c1056 commit fc6fe63
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 212 deletions.
5 changes: 3 additions & 2 deletions PHPUnit/Extensions/PhptTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
}

require_once 'PHP/CodeCoverage.php';
require_once 'PHP/Timer.php';

/**
* Wrapper to run .phpt test cases.
Expand Down Expand Up @@ -166,9 +167,9 @@ public function run(PHPUnit_Framework_TestResult $result = NULL, array $options

$result->startTest($this);

PHPUnit_Util_Timer::start();
PHP_Timer::start();
$buffer = $runner->run($this->filename, $options);
$time = PHPUnit_Util_Timer::stop();
$time = PHP_Timer::stop();
error_reporting($currentErrorReporting);
$base = basename($this->filename);
$path = dirname($this->filename);
Expand Down
5 changes: 3 additions & 2 deletions PHPUnit/Framework/TestResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
*/

require_once 'PHP/CodeCoverage.php';
require_once 'PHP/Timer.php';

/**
* A TestResult collects the results of executing a test case.
Expand Down Expand Up @@ -605,7 +606,7 @@ public function run(PHPUnit_Framework_Test $test)
$this->codeCoverage->start($test);
}

PHPUnit_Util_Timer::start();
PHP_Timer::start();

try {
$test->runBare();
Expand All @@ -619,7 +620,7 @@ public function run(PHPUnit_Framework_Test $test)
$error = TRUE;
}

$time = PHPUnit_Util_Timer::stop();
$time = PHP_Timer::stop();

if ($useXdebug) {
$data = $this->codeCoverage->stop(FALSE);
Expand Down
6 changes: 4 additions & 2 deletions PHPUnit/TextUI/ResultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
* @since File available since Release 2.0.0
*/

require_once 'PHP/Timer.php';

/**
* Prints the result of a TextUI TestRunner run.
*
Expand Down Expand Up @@ -323,11 +325,11 @@ protected function printSkipped(PHPUnit_Framework_TestResult $result)
protected function printHeader($timeElapsed)
{
if (isset($_SERVER['REQUEST_TIME'])) {
$timeElapsed = PHPUnit_Util_Timer::secondsToTimeString(
$timeElapsed = PHP_Timer::secondsToTimeString(
time() - $_SERVER['REQUEST_TIME']
);
} else {
$timeElapsed = PHPUnit_Util_Timer::secondsToTimeString(
$timeElapsed = PHP_Timer::secondsToTimeString(
$timeElapsed
);
}
Expand Down
125 changes: 0 additions & 125 deletions PHPUnit/Util/Timer.php

This file was deleted.

1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ PHPUnit 3.5.0
* Replaced `PHPUnit_Framework_MockObject` with the [PHP_MockObject](http://github.com/sebastianbergmann/php-mock-objects) component.
* Replaced `PHPUnit_Util_FilterIterator` with the [PHP_FileIterator](http://github.com/sebastianbergmann/php-file-iterator) component.
* Replaced `PHPUnit_Util_Template` with the [Text_Template](http://github.com/sebastianbergmann/php-text-template) component.
* Replaced `PHPUnit_Util_Timer` with the [PHP_Timer](http://github.com/sebastianbergmann/php-timer) component.
* PHPUnit now requires PHP 5.2.7 (or later) but PHP 5.3.2 (or later) is highly recommended.
2 changes: 0 additions & 2 deletions Tests/Util/TestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@

require_once 'PHPUnit/Framework/TestCase.php';

require_once 'PHPUnit/Util/Timer.php';

require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ExceptionTest.php';

/**
Expand Down
76 changes: 0 additions & 76 deletions Tests/Util/TimerTest.php

This file was deleted.

8 changes: 5 additions & 3 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,6 @@
<file baseinstalldir="/" name="TestSuiteIterator.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="Timer.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="Type.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
Expand Down Expand Up @@ -863,6 +860,11 @@
<channel>pear.phpunit.de</channel>
<min>1.0.0</min>
</package>
<package>
<name>PHP_Timer</name>
<channel>pear.phpunit.de</channel>
<min>1.0.0</min>
</package>
<package>
<name>PHPUnit_MockObject</name>
<channel>pear.phpunit.de</channel>
Expand Down

0 comments on commit fc6fe63

Please sign in to comment.