out = new ConsoleOutput(); $io = new ConsoleIo($this->out); $this->Shell = $this->getMock( 'Cake\Shell\CommandListShell', ['in', 'err', '_stop', 'clear'], [$io] ); $this->Shell->Command = $this->getMock( 'Cake\Shell\Task\CommandTask', ['in', '_stop', 'err', 'clear'], [$io] ); } /** * tearDown * * @return void */ public function tearDown() { parent::tearDown(); unset($this->Shell); Plugin::unload(); } /** * test that main finds core shells. * * @return void */ public function testMain() { $this->Shell->main(); $output = $this->out->messages(); $output = implode("\n", $output); $expected = "/\[.*TestPlugin.*\] example/"; $this->assertRegExp($expected, $output); $expected = "/\[.*TestPluginTwo.*\] example, welcome/"; $this->assertRegExp($expected, $output); $expected = "/\[.*CORE.*\] i18n, orm_cache, plugin, server/"; $this->assertRegExp($expected, $output); $expected = "/\[.*app.*\] sample/"; $this->assertRegExp($expected, $output); } /** * test xml output. * * @return void */ public function testMainXml() { $this->Shell->params['xml'] = true; $this->Shell->main(); $output = $this->out->messages(); $output = implode("\n", $output); $find = 'assertContains($find, $output); $find = 'assertContains($find, $output); $find = 'assertContains($find, $output); } }