public function testRouteCollection() {
list($low, $high) = $this
->createRouterMocks();
$lowcol = new RouteCollection();
$lowcol
->add('low', $this
->buildMock('Symfony\\Component\\Routing\\Route'));
$highcol = new RouteCollection();
$highcol
->add('high', $this
->buildMock('Symfony\\Component\\Routing\\Route'));
$low
->expects($this
->once())
->method('getRouteCollection')
->will($this
->returnValue($lowcol));
$high
->expects($this
->once())
->method('getRouteCollection')
->will($this
->returnValue($highcol));
$this->router
->add($low, 10);
$this->router
->add($high, 100);
$collection = $this->router
->getRouteCollection();
$this
->assertInstanceOf('Symfony\\Component\\Routing\\RouteCollection', $collection);
$names = array();
foreach ($collection
->all() as $name => $route) {
$this
->assertInstanceOf('Symfony\\Component\\Routing\\Route', $route);
$names[] = $name;
}
$this
->assertEquals(array(
'high',
'low',
), $names);
}