/** * Tests that a CLI route with no appropriate handlers throws an * exception. */ public function testCliRouteWithNoHandler() { $config = $this->getStandardConfig(); $router = new SnappyRouter(new Config($config)); $_SERVER['argv'] = array('dummyScript.php', '--task', 'NotDefinedTask', '--action', 'anyAction'); $_SERVER['argc'] = count($_SERVER['argv']); $response = $router->handleRoute(); $expected = 'No CLI handler registered.' . PHP_EOL; $this->assertEquals($expected, $response); }