Esempio n. 1
0
 private function runExpectation($expectation)
 {
     $expectation = ExpectationHelper::get($expectation);
     if (is_string($expectation)) {
         $runner = new $expectation($this->url, $this->output);
         return $runner->run();
     }
     return $expectation;
 }
Esempio n. 2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $expectations = [$input->getArgument('expectation')];
     if ($expectations === [NULL]) {
         $expectations = ExpectationHelper::getAll();
     }
     foreach ($expectations as $expectation) {
         if (!ExpectationHelper::has($expectation)) {
             $output->writeln("<error>Expectation '{$expectation}' not found</error>");
             continue;
         }
         $output->writeln("<info>{$expectation}:</info>");
         $expectation = ExpectationHelper::get($expectation);
         if (method_exists($expectation, "describe")) {
             $output->writeln($expectation::describe());
         }
         $output->writeln("");
     }
 }
Esempio n. 3
0
 public function __construct($url = NULL, $output = NULL)
 {
     $this->url = $url;
     $this->output = $output;
     $this->result = ExpectationHelper::initResults();
 }