/**
* @group 7
*/
public function testHandlersConfiguredViaRoutesDoNotOverwriteThoseAlreadyInDispatcher()
{
$phpunit = $this;
$dispatcher = new Dispatcher();
$dispatcher->map('test', function ($route, $console) use($phpunit) {
$phpunit->assertEquals('test', $route->getName());
return 2;
});
$routes = [['name' => 'test', 'route' => 'test', 'description' => 'Test handler capabilities', 'short_description' => 'Test handler capabilities', 'handler' => function ($route, $console) use($phpunit) {
$phpunit->fail('Handler from route configuration was invoked when it should not be');
return 3;
}]];
$application = new Application('ZFConsoleApplication', $this->version, $routes, $this->console, $dispatcher);
$this->assertEquals(2, $application->run(['test']));
}