Ejemplo n.º 1
0
 public function onFinished(TestName $test)
 {
     $key = array_search($test->toString(), $this->running);
     if ($key !== false) {
         unset($this->running[$key]);
     }
     if (!$this->running) {
         $this->onEnd();
     }
 }
Ejemplo n.º 2
0
 private function determineTestSuite(Test $test, TestName $name)
 {
     $filter = $this->configuration->getFilter();
     $factory = $this->configuration->getTestSuiteFactory();
     $first = $name->part(0);
     if (class_exists($first)) {
         $test = $factory->getTestSuite($first, $filter);
     }
     $file = $this->configuration->fullPath($first);
     if (file_exists($file)) {
         $test = new FileTestSuite($factory, $filter, $this->configuration->fullPath(), $first);
     }
     return $this->resolveTest($test, $name);
 }
Ejemplo n.º 3
0
 /**
  * @param string[] $arguments The command arguments (without the name of the script itself)
  * @throws \Exception
  * @return int The exit value
  */
 public function execute(array $arguments)
 {
     $configFile = null;
     $runConfig = [];
     $name = null;
     foreach ($arguments as $a) {
         $key = substr($a, 0, 2);
         $value = substr($a, 2);
         if ($key == '-l') {
             $runConfig['listen'][] = $value;
         } else {
             if ($key == '-c') {
                 $argConfig = json_decode($value, true);
                 if ($argConfig) {
                     $runConfig = array_merge_recursive($runConfig, $argConfig);
                 } else {
                     $configFile = $value;
                 }
             } else {
                 $name = TestName::parse($a);
             }
         }
     }
     $configuration = $this->reader->read($configFile, $runConfig);
     $runner = $configuration->getRunner();
     return $runner->run($name) ? 0 : 1;
 }
Ejemplo n.º 4
0
 function parseEscapedStrings(Assert $assert)
 {
     $name = TestName::parse('foo$:$:bar$:$:::$:b$$az');
     $assert($name->part(0), 'foo::bar::');
     $assert($name->part(1), ':b$az');
 }