Changeset 8481
- Timestamp:
- 04/16/08 14:00:54 (5 months ago)
- Files:
-
- branches/1.1/lib/command/cli.php (modified) (2 diffs)
- branches/1.1/test/other/tasksTest.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/command/cli.php
r7612 r8481 18 18 19 19 $application = new sfSymfonyCommandApplication($dispatcher, new sfAnsiColorFormatter(), array('symfony_lib_dir' => realpath(dirname(__FILE__).'/..'))); 20 $ application->run();20 $statusCode = $application->run(); 21 21 } 22 22 catch (Exception $e) … … 28 28 29 29 $application->renderException($e); 30 $statusCode = $e->getCode(); 30 31 31 exit( 1);32 exit(is_numeric($statusCode) && $statusCode ? $statusCode : 1); 32 33 } 33 34 34 exit( 0);35 exit(is_numeric($statusCode) ? $statusCode : 0); branches/1.1/test/other/tasksTest.php
r7962 r8481 47 47 } 48 48 49 public function execute_command($cmd )49 public function execute_command($cmd, $awaited_return=0) 50 50 { 51 51 $symfony = file_exists('symfony') ? 'symfony' : dirname(__FILE__).'/../../data/bin/symfony'; … … 54 54 passthru(sprintf('%s -d html_errors=off -d open_basedir= -q "%s" %s 2>&1', $this->php_cli, $symfony, $cmd), $return); 55 55 $content = ob_get_clean(); 56 $this->t->cmp_ok($return, ' <=', 0, sprintf('"symfony %s" returns ok', $cmd));56 $this->t->cmp_ok($return, '==', $awaited_return, sprintf('"symfony %s" returns awaited value (%d)', $cmd, $awaited_return)); 57 57 58 58 return $content; … … 65 65 } 66 66 67 $t = new lime_test(3 2, new lime_output_color());67 $t = new lime_test(33, new lime_output_color()); 68 68 $c = new symfony_cmd(); 69 69 $c->initialize($t); … … 75 75 $content = $c->execute_command('generate:app frontend'); 76 76 $t->ok(is_dir($c->tmp_dir.DS.'apps'.DS.'frontend'), '"generate:app" creates a "frontend" directory under "apps" directory'); 77 78 // failing 79 $content = $c->execute_command('generate:module wrongapp foo', 1); 77 80 78 81 $content = $c->execute_command('generate:module frontend foo');