Esempio n. 1
0
 /**
  * @test
  */
 public function findMatchResultsSetsLastMatchedRoute()
 {
     $mockHttpRequest = $this->getMockBuilder('TYPO3\\Flow\\Http\\Request')->disableOriginalConstructor()->getMock();
     $mockRoute1 = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\Routing\\Route')->getMock();
     $mockRoute1->expects($this->once())->method('matches')->with($mockHttpRequest)->will($this->returnValue(FALSE));
     $mockRoute2 = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\Routing\\Route')->getMock();
     $mockRoute2->expects($this->once())->method('matches')->with($mockHttpRequest)->will($this->returnValue(TRUE));
     $this->router->_set('routes', array($mockRoute1, $mockRoute2));
     $this->router->_call('findMatchResults', $mockHttpRequest);
     $this->assertSame($mockRoute2, $this->router->getLastMatchedRoute());
 }