public function DynamicRouterTest::testEventHandlerRequest in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony-cmf/routing/Tests/Routing/DynamicRouterTest.php \Symfony\Cmf\Component\Routing\Tests\Routing\DynamicRouterTest::testEventHandlerRequest()
File
- vendor/
symfony-cmf/ routing/ Tests/ Routing/ DynamicRouterTest.php, line 305
Class
Namespace
Symfony\Cmf\Component\Routing\Tests\RoutingCode
public function testEventHandlerRequest() {
$eventDispatcher = $this
->buildMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
$router = new DynamicRouter($this->context, $this->matcher, $this->generator, '', $eventDispatcher);
$that = $this;
$eventDispatcher
->expects($this
->once())
->method('dispatch')
->with(Events::PRE_DYNAMIC_MATCH_REQUEST, $this
->callback(function ($event) use ($that) {
$that
->assertInstanceOf('Symfony\\Cmf\\Component\\Routing\\Event\\RouterMatchEvent', $event);
$that
->assertEquals($that->request, $event
->getRequest());
return true;
}));
$routeDefaults = array(
'foo' => 'bar',
);
$this->matcher
->expects($this
->once())
->method('match')
->with($this->url)
->will($this
->returnValue($routeDefaults));
$this
->assertEquals($routeDefaults, $router
->matchRequest($this->request));
}