loadPlugins(['TestPlugin', 'TestPluginTwo']); } /** * tearDown * * @return void */ public function tearDown() { parent::tearDown(); $this->clearPlugins(); } /** * test that main finds core shells. * * @return void */ public function testMain() { $this->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, schema_cache, server/"; $this->assertOutputRegExp($expected); $expected = "/\[.*app.*\] abort, auto_load_model, demo, i18m, integration, merge, 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, schema_cache, server, version/"; $this->assertOutputRegExp($expected); $expected = "/\[.*app.*\] abort, auto_load_model, demo, i18n, integration, merge, 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(); } }