示例#1
0
 /**
  * Prepares the arguments that can be sent to phpunit
  * @return string
  */
 protected function preparePhpunitArguments()
 {
     $arguments = array("--colors");
     if ($this->hasBootstrapFile()) {
         $arguments[] = "--bootstrap " . $this->getBootstrapFile();
     } else {
         $arguments[] = "--bootstrap " . Strata::getVendorPath() . "autoload.php";
     }
     $arguments[] = sprintf("--log-junit %s/unittest/strata_test_results.xml", Strata::getTmpPath());
     return implode(" ", $arguments);
 }
 /**
  * Generates the API documentation contents
  * @return null
  */
 protected function generateAPI()
 {
     $srcPath = Strata::getSRCPath();
     $vendorPath = Strata::getVendorPath();
     $tmpPath = Strata::getTmpPath();
     $this->output->writeLn("<info>Generating API</info>");
     $this->output->writeLn($this->tree(true) . "Scanning {$srcPath}");
     $this->nl();
     if (!file_exists($tmpPath . "phploc.xml")) {
         touch($tmpPath . "phploc.xml");
     }
     if (!file_exists($tmpPath . "phpcs.xml")) {
         touch($tmpPath . "phpcs.xml");
     }
     system(sprintf("%sbin/phploc  --log-xml %sphploc.xml test", $vendorPath, $tmpPath));
     system(sprintf("%sbin/phpcs src --standard=PSR2 --report-xml=%sphpcs.xml", $vendorPath, $tmpPath));
     system(sprintf("%sbin/phpdox", $vendorPath));
 }