Ejemplo n.º 1
0
 /**
  * Gets the formatter from world and register it into the reporter
  */
 protected function setFormatter()
 {
     $formatterOption = $this->_world->getOption('formatter');
     $formatter = $this->getFormatterFactory()->create($formatterOption, $this->_world->getReporter());
     $this->_world->getReporter()->addFormatter($formatter);
 }
Ejemplo n.º 2
0
 /**
  * Loads the bootstrap file if specified in the options
  */
 public function bootstrap(\PHPSpec\World $world)
 {
     $bootstrapFile = $world->getOption('bootstrap');
     if (empty($bootstrapFile)) {
         return;
     }
     if (!file_exists($bootstrapFile) || !is_readable($bootstrapFile)) {
         throw new CliError('Cannot load specified bootstrap file: ' . $bootstrapFile);
     }
     include $bootstrapFile;
 }