exec('command_list'); $expected = "/\[.*TestPlugin.*\] example/"; $this->assertOutputRegExp($expected); $expected = "/\[.*TestPluginTwo.*\] example, unique, welcome/"; $this->assertOutputRegExp($expected); $expected = "/\[.*CORE.*\] cache, help, i18n, orm_cache, plugin, routes, server/"; $this->assertOutputRegExp($expected); $expected = "/\[.*app.*\] i18m, integration, sample/"; $this->assertOutputRegExp($expected); $this->assertExitCode(Shell::CODE_SUCCESS); $this->assertErrorEmpty(); } /** * If there is an app shell with the same name as a core shell, * tests that the app shell is the one displayed and the core one is hidden. * * @return void */ public function testMainAppPriority() { rename(APP . 'Shell' . DS . 'I18mShell.php', APP . 'Shell' . DS . 'I18nShell.php'); $this->exec('command_list'); rename(APP . 'Shell' . DS . 'I18nShell.php', APP . 'Shell' . DS . 'I18mShell.php'); $expected = "/\[.*CORE.*\] cache, help, orm_cache, plugin, routes, server/"; $this->assertOutputRegExp($expected); $expected = "/\[.*app.*\] i18n, integration, sample/"; $this->assertOutputRegExp($expected); $this->assertExitCode(Shell::CODE_SUCCESS); $this->assertErrorEmpty(); } /** * test xml output. * * @return void */ public function testMainXml() { $this->exec('command_list --xml'); $find = 'assertOutputContains($find); $find = 'assertOutputContains($find); $find = 'assertOutputContains($find); $this->assertExitCode(Shell::CODE_SUCCESS); $this->assertErrorEmpty(); } /** * test that main prints the cakephp's version. * * @return void */ public function testMainVersion() { $this->exec('command_list --version'); $expected = Configure::version(); $this->assertOutputContains($expected); $this->assertExitCode(Shell::CODE_SUCCESS); $this->assertErrorEmpty(); } }