예제 #1
0
파일: router.php 프로젝트: bermi/akelos
 public function testUrlizeUsingAnNamedRouteThrowsIfNotApplicable()
 {
     $AuthorRoute = $this->mock('AkRoute', array('urlize' => new RouteDoesNotMatchParametersException()));
     $this->Router->addRoute('author', $AuthorRoute);
     $this->expectException('RouteDoesNotMatchParametersException');
     $this->Router->author_url(array('name' => 'martin'));
 }
예제 #2
0
파일: RouterTest.php 프로젝트: joeymetal/v1
 function testUrlizeUsingAnNamedRouteThrowsIfNotApplicable()
 {
     $AuthorRoute = $this->getMock('AkRoute', array(), array('author/:name'));
     $AuthorRoute->expects($this->once())->method('urlize')->with(array('name' => 'martin'))->will($this->throwException(new RouteDoesNotMatchParametersException()));
     $this->Router->addRoute('author', $AuthorRoute);
     $this->setExpectedException('RouteDoesNotMatchParametersException');
     $this->Router->author_url(array('name' => 'martin'));
 }