2
2
3
3
namespace Http \Client \Tests ;
4
4
5
- use PHPUnit \Framework \Test ;
6
- use PHPUnit \TextUI \ResultPrinter ;
7
-
8
- class FeatureTestListener extends ResultPrinter
5
+ trait FeatureTestListener
9
6
{
10
7
public function write ($ buffer )
11
8
{
12
9
}
13
10
14
- public function startTest ( Test $ test )
11
+ protected function doStartTest ( $ test )
15
12
{
16
13
$ feature = $ this ->extractFeature ($ test );
17
14
@@ -24,7 +21,7 @@ public function startTest(Test $test)
24
21
echo sprintf ('%-40.s : ' , $ feature );
25
22
}
26
23
27
- public function endTest ( Test $ test , $ time )
24
+ protected function doEndTest ( $ test , $ time )
28
25
{
29
26
if (!$ this ->lastTestFailed ) {
30
27
echo $ this ->formatWithColor ('fg-green ' , 'Supported ' )."\n" ;
@@ -35,10 +32,10 @@ public function endTest(Test $test, $time)
35
32
$ this ->lastTestFailed = false ;
36
33
}
37
34
38
- private function extractFeature (Test $ test )
35
+ private function extractFeature ($ test )
39
36
{
40
37
$ class = get_class ($ test );
41
- $ method = $ test ->getName ();
38
+ $ method = $ test ->getName (false );
42
39
$ reflection = new \ReflectionMethod ($ class , $ method );
43
40
44
41
return $ this ->parseDocBlock ($ reflection ->getDocComment (), '@feature ' );
0 commit comments