Created
March 8, 2013 08:59
-
-
Save isidromerayo/5115136 to your computer and use it in GitHub Desktop.
Show time to execute test :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<phpunit backupGlobals="false" | |
backupStaticAttributes="false" | |
syntaxCheck="false" | |
colors="true" | |
bootstrap="./bootstrap.php"> | |
<testsuites> | |
<testsuite name="Test Suite"> | |
<directory suffix="Test.php">./</directory> | |
</testsuite> | |
</testsuites> | |
<listeners> | |
<listener class="SimpleTestListener" file="./SimpleTestListener.php"> | |
</listener> | |
</listeners> | |
</phpunit> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SimpleTestListener implements \PHPUnit_Framework_TestListener | |
{ | |
public function endTest(\PHPUnit_Framework_Test $test, $time) | |
{ | |
printf("Test '%s' terminado y ha tardado %s segundos " . PHP_EOL, | |
get_class($test) . '=>' . $test->getName(), | |
number_format($time,3) | |
); | |
} | |
public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) { | |
} | |
public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) { | |
} | |
public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) { | |
} | |
public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) { | |
} | |
public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) { | |
} | |
public function startTest(\PHPUnit_Framework_Test $test) { | |
} | |
public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment