run() public method

Runs all tests.
public run ( ) : boolean
return boolean
Beispiel #1
0
 /** @return void */
 private function watch(Runner $runner)
 {
     $prev = array();
     $counter = 0;
     while (TRUE) {
         $state = array();
         foreach ($this->options['--watch'] as $directory) {
             foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory)) as $file) {
                 if (substr($file->getExtension(), 0, 3) === 'php' && substr($file->getBasename(), 0, 1) !== '.') {
                     $state[(string) $file] = md5_file((string) $file);
                 }
             }
         }
         if ($state !== $prev) {
             $prev = $state;
             $runner->run();
         }
         echo "Watching " . implode(', ', $this->options['--watch']) . " " . str_repeat('.', ++$counter % 5) . "    \r";
         sleep(2);
     }
 }