output .= $message; } } class CommandListTest extends CakeTestCase { /** * setUp method * * @return void */ public function setUp() { parent::setUp(); App::build(array( 'plugins' => array( TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS ), 'shells' => array( CORE_PATH ? CORE_PATH . CAKE . 'console' . DS . 'shells' . DS : CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'shells' .DS, TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS ) ), true); App::objects('plugins', null, false); $this->Dispatcher = $this->getMock( 'ShellDispatcher', array('_stop', '_initEnvironment', 'dispatch') ); $out = new TestStringOutput(); $in = $this->getMock('ConsoleInput', array(), array(), '', false); $this->Shell = $this->getMock( 'CommandListShell', array('in', '_stop', 'clear'), array(&$this->Dispatcher, $out, $out, $in) ); } /** * teardown * * @return void */ function tearDown() { parent::tearDown(); unset($this->Dispatcher, $this->Shell); } /** * test that main finds core shells. * * @return void */ function testMain() { $this->Shell->main(); $output = $this->Shell->stdout->output; $expected = "/example \[.*TestPlugin, TestPluginTwo.*\]/"; $this->assertPattern($expected, $output); $expected = "/welcome \[.*TestPluginTwo.*\]/"; $this->assertPattern($expected, $output); $expected = "/acl \[.*CORE.*\]/"; $this->assertPattern($expected, $output); $expected = "/api \[.*CORE.*\]/"; $this->assertPattern($expected, $output); $expected = "/bake \[.*CORE.*\]/"; $this->assertPattern($expected, $output); $expected = "/console \[.*CORE.*\]/"; $this->assertPattern($expected, $output); $expected = "/i18n \[.*CORE.*\]/"; $this->assertPattern($expected, $output); $expected = "/schema \[.*CORE.*\]/"; $this->assertPattern($expected, $output); $expected = "/testsuite \[.*CORE.*\]/"; $this->assertPattern($expected, $output); $expected = "/sample \[.*app.*\]/"; $this->assertPattern($expected, $output); } }