@@ -135,8 +135,8 @@ class Tests {
135135 * @param array basic configuration
136136 * @param array command line
137137 */
138- public function __construct (TestsConfiguration & $ config ) {
139- $ this ->config = & $ config ;
138+ public function __construct (TestsConfiguration $ config ) {
139+ $ this ->config = $ config ;
140140
141141 if ($ this ->config ->hasFlag ('help ' ) ||
142142 $ this ->config ->hasFlag ('h ' )) {
@@ -153,7 +153,7 @@ public function findPaths($in = null) {
153153 $ paths = array ();
154154 $ where = ($ in != null ) ? array ($ in ) : $ this ->config ['path ' ];
155155
156- foreach ($ where as & $ path ) {
156+ foreach ($ where as $ path ) {
157157 if ($ path ) {
158158 if (is_dir ($ path )) {
159159 $ paths [] = $ path ;
@@ -243,6 +243,7 @@ protected function showUsage() {
243243 printf ("\t--options \toptions to pass to phpdbg%s " , PHP_EOL );
244244 printf ("\t--phpdbg \tpath to phpdbg binary%s " , PHP_EOL );
245245 printf ('[flags]:%s ' , PHP_EOL );
246+ printf ("\t-diff2stdout \t\twrite diff to stdout instead of files%s " , PHP_EOL );
246247 printf ("\t-nodiff \t\tdo not write diffs on failure%s " , PHP_EOL );
247248 printf ("\t-nolog \t\tdo not write logs on failure%s " , PHP_EOL );
248249 printf ('[examples]:%s ' , PHP_EOL );
@@ -266,9 +267,11 @@ public function findTests($path) {
266267 $ test = sprintf ('%s/%s ' , $ path , $ file );
267268
268269 if (preg_match ('~\.test$~ ' , $ test )) {
269- yield new Test ($ this ->config , $ test );
270+ $ tests [] = new Test ($ this ->config , $ test );
270271 }
271272 }
273+
274+ return $ tests ;
272275 }
273276
274277 /**
@@ -354,7 +357,7 @@ class Test {
354357 * @param array configuration
355358 * @param string file
356359 */
357- public function __construct (TestsConfiguration & $ config , & $ file ) {
360+ public function __construct (TestsConfiguration $ config , $ file ) {
358361 if (($ handle = fopen ($ file , 'r ' ))) {
359362 while (($ line = fgets ($ handle ))) {
360363 $ trim = trim ($ line );
@@ -417,8 +420,8 @@ public function __construct(TestsConfiguration &$config, &$file) {
417420 }
418421 fclose ($ handle );
419422
420- $ this ->config = & $ config ;
421- $ this ->file = & $ file ;
423+ $ this ->config = $ config ;
424+ $ this ->file = $ file ;
422425 }
423426 }
424427
@@ -427,8 +430,7 @@ public function __construct(TestsConfiguration &$config, &$file) {
427430 *
428431 */
429432 public function getResult () {
430- $ options = sprintf (
431- '-i%s -nqb ' , $ this ->file );
433+ $ options = sprintf ('-i%s -nqb ' , $ this ->file );
432434
433435 if ($ this ->options ) {
434436 $ options = sprintf (
@@ -526,7 +528,7 @@ protected function writeDiff() {
526528 * Write log to disk if configuration allows it
527529 *
528530 */
529- protected function writeLog (& $ result = null ) {
531+ protected function writeLog ($ result = null ) {
530532 $ log = sprintf (
531533 '%s/%s.log ' ,
532534 dirname ($ this ->file ), basename ($ this ->file ));
0 commit comments