Skip to content

Commit 9f18ae4

Browse files
committed
Refactoring SpeedTrapListener class
1 parent cbd785f commit 9f18ae4

File tree

1 file changed

+2
-77
lines changed

1 file changed

+2
-77
lines changed

src/SpeedTrapListener.php

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
namespace JohnKary\PHPUnit\Listener;
55

6-
use PHPUnit\Framework\{AssertionFailedError, TestSuite, Test, TestCase, TestListener, Warning};
6+
use PHPUnit\Framework\{AssertionFailedError, TestSuite, Test, TestCase, BaseTestListener, Warning};
77

88
/**
99
* A PHPUnit TestListener that exposes your slowest running tests by outputting
1010
* results directly to the console.
1111
*/
12-
class SpeedTrapListener implements TestListener
12+
class SpeedTrapListener extends BaseTestListener
1313
{
1414
/**
1515
* Internal tracking for test suites.
@@ -46,81 +46,6 @@ public function __construct(array $options = [])
4646
$this->loadOptions($options);
4747
}
4848

49-
/**
50-
* An error occurred.
51-
*
52-
* @param Test $test
53-
* @param \Exception $e
54-
* @param float $time
55-
*/
56-
public function addError(Test $test, \Exception $e, $time)
57-
{
58-
}
59-
60-
/**
61-
* A warning occurred.
62-
*
63-
* @param Test $test
64-
* @param Warning $e
65-
* @param float $time
66-
*/
67-
public function addWarning(Test $test, Warning $e, $time)
68-
{
69-
}
70-
71-
/**
72-
* A failure occurred.
73-
*
74-
* @param Test $test
75-
* @param AssertionFailedError $e
76-
* @param float $time
77-
*/
78-
public function addFailure(Test $test, AssertionFailedError $e, $time)
79-
{
80-
}
81-
82-
/**
83-
* Incomplete test.
84-
*
85-
* @param Test $test
86-
* @param \Exception $e
87-
* @param float $time
88-
*/
89-
public function addIncompleteTest(Test $test, \Exception $e, $time)
90-
{
91-
}
92-
93-
/**
94-
* Risky test.
95-
*
96-
* @param Test $test
97-
* @param \Exception $e
98-
* @param float $time
99-
*/
100-
public function addRiskyTest(Test $test, \Exception $e, $time)
101-
{
102-
}
103-
104-
/**
105-
* Skipped test.
106-
*
107-
* @param Test $test
108-
* @param \Exception $e
109-
* @param float $time
110-
*/
111-
public function addSkippedTest(Test $test, \Exception $e, $time)
112-
{
113-
}
114-
115-
/**
116-
* A test started.
117-
*
118-
* @param Test $test
119-
*/
120-
public function startTest(Test $test)
121-
{
122-
}
123-
12449
/**
12550
* A test ended.
12651
*

0 commit comments

Comments
 (0)