22
33namespace Http \Client \Tests ;
44
5- use PHPUnit \Framework \Test ;
6- use PHPUnit \TextUI \ResultPrinter ;
7-
8- class FeatureTestListener extends ResultPrinter
5+ trait FeatureTestListener
96{
107 public function write ($ buffer )
118 {
129 }
1310
14- public function startTest ( Test $ test )
11+ protected function doStartTest ( $ test )
1512 {
1613 $ feature = $ this ->extractFeature ($ test );
1714
@@ -24,7 +21,7 @@ public function startTest(Test $test)
2421 echo sprintf ('%-40.s : ' , $ feature );
2522 }
2623
27- public function endTest ( Test $ test , $ time )
24+ protected function doEndTest ( $ test , $ time )
2825 {
2926 if (!$ this ->lastTestFailed ) {
3027 echo $ this ->formatWithColor ('fg-green ' , 'Supported ' )."\n" ;
@@ -35,10 +32,10 @@ public function endTest(Test $test, $time)
3532 $ this ->lastTestFailed = false ;
3633 }
3734
38- private function extractFeature (Test $ test )
35+ private function extractFeature ($ test )
3936 {
4037 $ class = get_class ($ test );
41- $ method = $ test ->getName ();
38+ $ method = $ test ->getName (false );
4239 $ reflection = new \ReflectionMethod ($ class , $ method );
4340
4441 return $ this ->parseDocBlock ($ reflection ->getDocComment (), '@feature ' );
0 commit comments