1 | <?php |
||
19 | class ExecutionTimeTestListener implements PHPUnit_Framework_TestListener { |
||
20 | |||
21 | protected $testCollector = []; |
||
22 | protected $executionTimeThresholdInSeconds = 10; |
||
23 | protected $isEnabledToListen = true; |
||
24 | |||
25 | /** |
||
26 | * ExecutionTimeTestListener constructor. |
||
27 | * |
||
28 | * @param bool $isEnabledToListen |
||
29 | * @param int $executionTimeThresholdInSeconds |
||
30 | */ |
||
31 | public function __construct( $isEnabledToListen, $executionTimeThresholdInSeconds ) { |
||
35 | |||
36 | /** |
||
37 | * @see PHPUnit_Framework_TestListener::startTest |
||
38 | */ |
||
39 | public function startTest( PHPUnit_Framework_Test $test ) { |
||
41 | |||
42 | /** |
||
43 | * @see PHPUnit_Framework_TestListener::endTest |
||
44 | */ |
||
45 | public function endTest( PHPUnit_Framework_Test $test, $length ) { |
||
50 | |||
51 | /** |
||
52 | * @see PHPUnit_Framework_TestListener::addError |
||
53 | */ |
||
54 | public function addError( PHPUnit_Framework_Test $test, Exception $e, $time ) { |
||
56 | |||
57 | /** |
||
58 | * @see PHPUnit_Framework_TestListener::addFailure |
||
59 | */ |
||
60 | public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time ) { |
||
62 | |||
63 | /** |
||
64 | * @see PHPUnit_Framework_TestListener::addError |
||
65 | */ |
||
66 | public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $time ) { |
||
68 | |||
69 | /** |
||
70 | * @see PHPUnit_Framework_TestListener::addRiskyTest |
||
71 | * @since 4.0.0 |
||
72 | */ |
||
73 | public function addRiskyTest( PHPUnit_Framework_Test $test, Exception $e, $time ) { |
||
75 | |||
76 | /** |
||
77 | * @see PHPUnit_Framework_TestListener::addSkippedTest |
||
78 | */ |
||
79 | public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $time ) { |
||
81 | |||
82 | /** |
||
83 | * @see PHPUnit_Framework_TestListener::addWarning |
||
84 | * @since 6.0.0 |
||
85 | */ |
||
86 | public function addWarning( PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, $time ) { |
||
88 | |||
89 | /** |
||
90 | * @see PHPUnit_Framework_TestListener::startTestSuite |
||
91 | */ |
||
92 | public function startTestSuite( PHPUnit_Framework_TestSuite $suite ) { |
||
94 | |||
95 | /** |
||
96 | * @see PHPUnit_Framework_TestListener::endTestSuite |
||
97 | */ |
||
98 | public function endTestSuite( PHPUnit_Framework_TestSuite $suite ) { |
||
104 | |||
105 | } |
||
106 |