Beispiel #1
0
 public function main()
 {
     $this->_initDb();
     $args = $_SERVER['argv'];
     do {
         array_shift($args);
     } while ($args[0] != 'Bdd.story');
     // Internal encoding to utf8
     mb_internal_encoding('utf8');
     $app = new Behat\Behat\Console\BehatApplication(BEHAT_VERSION);
     $command_option = false;
     foreach ($args as $option) {
         $option = str_replace("-", "", $option);
         if ($app->getDefinition()->hasOption($option) || $app->getDefinition()->hasShortcut($option)) {
             $command_option = true;
             break;
         }
     }
     // Load default config
     if (!in_array('--config', $args) && !in_array('-c', $args) && !$command_option) {
         array_push($args, '--config', APP . DS . 'Config' . DS . 'behat.yml');
     }
     $input = new Symfony\Component\Console\Input\ArgvInput($args);
     $app->run($input);
 }