setAppNamespace(); $this->useCommandRunner(true); Plugin::load('TestPlugin'); } /** * Test the command listing fallback when no commands are set * * @return void */ public function testMainNoCommandsFallback() { $this->exec('help'); $this->assertExitCode(Shell::CODE_SUCCESS); $this->assertCommandList(); } /** * Test the command listing * * @return void */ public function testMain() { $this->exec('help'); $this->assertExitCode(Shell::CODE_SUCCESS); $this->assertCommandList(); } /** * Assert the help output. * * @param string $output The output to check. * @return void */ protected function assertCommandList() { $this->assertOutputContains('- widget', 'plugin command'); $this->assertOutputNotContains( '- test_plugin.widget', 'only short alias for plugin command.' ); $this->assertOutputContains('- sample', 'app shell'); $this->assertOutputContains('- test_plugin.sample', 'Long plugin name'); $this->assertOutputContains('- routes', 'core shell'); $this->assertOutputContains('- example', 'short plugin name'); $this->assertOutputContains('To run a command', 'more info present'); $this->assertOutputContains('To get help', 'more info present'); } /** * Test help --xml * * @return void */ public function testMainAsXml() { $this->exec('help --xml'); $this->assertExitCode(Shell::CODE_SUCCESS); $this->assertOutputContains(''); $find = 'assertOutputContains($find); $find = 'assertOutputContains($find); $find = 'assertOutputContains($find); } }