public function testMatchRequest() {
$routeDefaults = array(
'foo' => 'bar',
);
$matcher = $this
->buildMock('Symfony\\Component\\Routing\\Matcher\\RequestMatcherInterface', array(
'matchRequest',
'setContext',
'getContext',
));
$router = new DynamicRouter($this->context, $matcher, $this->generator);
$matcher
->expects($this
->once())
->method('matchRequest')
->with($this->request)
->will($this
->returnValue($routeDefaults));
$expected = array(
'this' => 'that',
);
$this->enhancer
->expects($this
->once())
->method('enhance')
->with($this
->equalTo($routeDefaults), $this
->equalTo($this->request))
->will($this
->returnValue($expected));
$router
->addRouteEnhancer($this->enhancer);
$this
->assertEquals($expected, $router
->matchRequest($this->request));
}