@@ -40,30 +40,44 @@ protected function printDefectTrace(TestFailure $defect): void
4040 $ e = $ defect ->thrownException ();
4141
4242 $ errorLines = array_filter (
43- explode (PHP_EOL , (string )$ e ),
44- function ($ l ){ return $ l ; }
43+ explode (PHP_EOL , (string )$ e ),
44+ function ($ l ) {
45+ return $ l ;
46+ }
4547 );
4648
4749 list ($ path , $ line ) = explode (": " , end ($ errorLines ));
4850
4951 if (!$ path ) {
50- list ($ path , $ line ) = $ this ->getReflectionFromTest ($ defect ->getTestName ());
52+ list ($ path , $ line ) = $ this ->getReflectionFromTest (
53+ $ defect ->getTestName ()
54+ );
5155 }
5256
5357 $ message = explode (PHP_EOL , $ e ->getMessage ())[0 ];
5458
55- $ this ->write (":: {$ this ->getCurrentType ()} file= {$ this ->relativePath ($ path )},line= {$ line }:: {$ message }\n" );
59+ $ type = $ this ->getCurrentType ();
60+ $ file = "file= {$ this ->relativePath ($ path )}" ;
61+ $ line = "line= {$ line }" ;
62+ $ this ->write (":: {$ type } $ file, $ line:: {$ message }\n" );
5663 }
5764
58- protected function getCurrentType () {
59- return in_array ($ this ->currentType , ['error ' , 'failure ' ]) ? 'error ' : 'warning ' ;
65+ protected function getCurrentType ()
66+ {
67+ if (in_array ($ this ->currentType , ['error ' , 'failure ' ])) {
68+ return 'error ' ;
69+ }
70+
71+ return 'warning ' ;
6072 }
6173
62- protected function relativePath (string $ path ) {
63- return str_replace (getcwd ().'/ ' , '' , $ path );
74+ protected function relativePath (string $ path )
75+ {
76+ return str_replace (getcwd () . '/ ' , '' , $ path );
6477 }
6578
66- protected function getReflectionFromTest (string $ name ) {
79+ protected function getReflectionFromTest (string $ name )
80+ {
6781 list ($ klass , $ method ) = explode (':: ' , $ name );
6882 $ c = new \ReflectionClass ($ klass );
6983 $ m = $ c ->getMethod ($ method );
0 commit comments