コード例 #1
0
 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     foreach ($arguments['plugin'] as $plugin) {
         $this->checkPluginExists($plugin);
     }
     if ($options['only'] && !in_array($options['only'], array('unit', 'functional'))) {
         throw new sfCommandException(sprintf('The --only option must be either "unit" or "functional" ("%s" given)', $options['only']));
     }
     // use the test:* task but filter the files
     $this->plugins = $arguments['plugin'];
     $this->dispatcher->connect('task.test.filter_test_files', array($this, 'filterTestFiles'));
     switch ($options['only']) {
         case 'unit':
             $task = new sfTestUnitTask($this->dispatcher, $this->formatter);
             break;
         case 'functional':
             $task = new sfTestFunctionalTask($this->dispatcher, $this->formatter);
             break;
         default:
             $task = new sfTestAllTask($this->dispatcher, $this->formatter);
     }
     $task->setConfiguration($this->configuration);
     $task->setCommandApplication($this->commandApplication);
     $task->run();
     $this->dispatcher->disconnect('task.test.filter_test_files', array($this, 'filterTestFiles'));
 }
コード例 #2
0
 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     $buildAllReload = new sfDoctrineBuildAllReloadTask($this->dispatcher, $this->formatter);
     $buildAllReload->setCommandApplication($this->commandApplication);
     $buildAllReloadOptions = array();
     if (!empty($options['application'])) {
         $buildAllReloadOptions[] = '--application=' . $options['application'];
     }
     $buildAllReloadOptions[] = '--env=' . $options['env'];
     if (!empty($options['dir'])) {
         $buildAllReloadOptions[] = '--dir=' . implode(' --dir=', $options['dir']);
     }
     if (isset($options['append']) && $options['append']) {
         $buildAllReloadOptions[] = '--append';
     }
     if (isset($options['no-confirmation']) && $options['no-confirmation']) {
         $buildAllReloadOptions[] = '--no-confirmation';
     }
     $ret = $buildAllReload->run(array(), $buildAllReloadOptions);
     if ($ret) {
         return $ret;
     }
     $this->logSection('doctrine', 'running test suite');
     $testAll = new sfTestAllTask($this->dispatcher, $this->formatter);
     $testAll->setCommandApplication($this->commandApplication);
     $testAll->run();
 }
 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     $buildAllReload = new sfDoctrineBuildAllReloadTask($this->dispatcher, $this->formatter);
     $buildAllReload->setCommandApplication($this->commandApplication);
     $buildAllReload->setConfiguration($this->configuration);
     $ret = $buildAllReload->run(array(), array('dir' => $options['dir'], 'append' => $options['append'], 'skip-forms' => $options['skip-forms'], 'no-confirmation' => $options['no-confirmation'], 'migrate' => $options['migrate']));
     if ($ret) {
         return $ret;
     }
     $this->logSection('doctrine', 'running test suite');
     $testAll = new sfTestAllTask($this->dispatcher, $this->formatter);
     $testAll->setCommandApplication($this->commandApplication);
     $testAll->setConfiguration($this->configuration);
     $testAll->run();
 }
コード例 #4
0
 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     $buildAllReload = new sfDoctrineBuildAllReloadTask($this->dispatcher, $this->formatter);
     $buildAllReload->setCommandApplication($this->commandApplication);
     $buildAllReloadOptions = array();
     $buildAllReloadOptions[] = '--env=' . $options['env'];
     if (!empty($options['dir'])) {
         $buildAllReloadOptions[] = '--dir=' . implode(' --dir=', $options['dir']);
     }
     if (isset($options['append']) && $options['append']) {
         $buildAllReloadOptions[] = '--append';
     }
     if (isset($options['force']) && $options['force']) {
         $buildAllReloadOptions[] = '--force';
     }
     $buildAllReload->run(array('application' => $arguments['application']), $buildAllReloadOptions);
     $testAll = new sfTestAllTask($this->dispatcher, $this->formatter);
     $testAll->setCommandApplication($this->commandApplication);
     $testAll->run();
 }