Ejemplo n.º 1
0
 /**
  * @test
  */
 public function resolveSetsLastResolvedRoute()
 {
     $routeValues = array('some' => 'route values');
     $mockRoute1 = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\Routing\\Route')->getMock();
     $mockRoute1->expects($this->once())->method('resolves')->with($routeValues)->will($this->returnValue(FALSE));
     $mockRoute2 = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\Routing\\Route')->getMock();
     $mockRoute2->expects($this->once())->method('resolves')->with($routeValues)->will($this->returnValue(TRUE));
     $this->router->_set('routes', array($mockRoute1, $mockRoute2));
     $this->router->resolve($routeValues);
     $this->assertSame($mockRoute2, $this->router->getLastResolvedRoute());
 }
 /**
  * @test
  */
 public function getLastResolvedRouteReturnsNullByDefault()
 {
     $this->assertNull($this->router->getLastResolvedRoute());
 }