Example #1
0
 protected function execute(array $arguments = array(), array $options = array())
 {
     if (nbConfig::has('project_type')) {
         $projectType = nbConfig::get('project_type');
         if ($projectType == "bee") {
             $unitTest = new nbBeeTestUnitCommand();
             $retUnit = $unitTest->run(new nbCommandLineParser(), '', true);
             $pluginsTest = new nbBeeTestPluginsCommand();
             $retPlugin = $pluginsTest->run(new nbCommandLineParser(), '', true);
             if ($retUnit == 0 or $retPlugin == 0) {
                 return 0;
             } else {
                 return 1;
             }
         } else {
             try {
                 $commandSet = $this->getApplication()->getCommands();
                 $testAllCmd = $commandSet->getCommand($projectType . ':test-all');
                 $testAllCmd->run(new nbCommandLineParser(), '', true);
                 return true;
             } catch (Exception $e) {
                 $this->logLine($e->getMessage(), nbLogger::ERROR);
                 return false;
             }
         }
     } else {
         throw new Exception('Project type not defined');
     }
 }
Example #2
0
 protected function execute(array $arguments = array(), array $options = array())
 {
     $testCmd = new nbBeeTestUnitCommand();
     $pluginTestDirs = nbConfig::get('nb_plugin_test_dirs');
     $options['dir'] = $pluginTestDirs;
     $options['exclude-project-folder'] = true;
     $ret = $testCmd->execute($arguments, $options);
     return $ret;
 }