Exemplo n.º 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->url = $this->normaliseURL($input->getArgument("url"));
     $this->output = $output;
     $expectations = $input->getOption('expectation');
     if (empty($expectations)) {
         $expectations = ExpectationHelper::getAll();
     }
     $results = ExpectationHelper::initResults();
     $output->writeln(">> Starting tests on " . $this->url);
     foreach ($expectations as $expectation) {
         $result = $this->runExpectation($expectation);
         $results = array_merge_recursive($results, $result);
     }
     $output->writeln(">> Tests complete.");
     $output->writeln(">> <info>" . count($results["PASS"]) . " passes</info>, <comment>" . count($results["WARN"]) . " warnings</comment>, <error>" . count($results["FAIL"]) . " failures</error>");
     $output->writeln(">> Failures represent items that in almost all cases should be fixed.");
     $output->writeln(">> Warnings represent items that in some cases might need to be fixed.");
     $output->writeln(">> Gated sites may produce false postives: Always review these results with a developer.");
     return count($results["FAIL"]);
 }
Exemplo n.º 2
0
 public function __construct($url = NULL, $output = NULL)
 {
     $this->url = $url;
     $this->output = $output;
     $this->result = ExpectationHelper::initResults();
 }