예제 #1
0
파일: rails.php 프로젝트: bmdevel/ezc
 function testNamedRoutesMissingArgument()
 {
     $request = new ezcMvcRequest();
     $request->uri = 'entry/get/89';
     $router = new testNamedRouter($request);
     try {
         $router->generateUrl('info', array());
         self::fail("Expected exception not thrown.");
     } catch (ezcMvcMissingRouteArgumentException $e) {
         self::assertEquals("The argument 'id' was not specified while generating a URL out of the route with pattern 'entry/:id/info'.", $e->getMessage());
     }
     try {
         $router->generateUrl('multiple1', array('person' => 'derick'));
     } catch (ezcMvcMissingRouteArgumentException $e) {
         self::assertEquals("The argument 'relation' was not specified while generating a URL out of the route with pattern 'e/:person/:relation'.", $e->getMessage());
     }
 }
예제 #2
0
파일: router.php 프로젝트: bmdevel/ezc
 function testNamedRouteThatDoesNotSupportReversedRoutes()
 {
     $request = new ezcMvcRequest();
     $request->uri = 'entry/get/89';
     $router = new testNamedRouter($request);
     try {
         $foo = $router->generateUrl('no-reverse');
         self::fail('Expected exception not thrown.');
     } catch (ezcMvcNamedRouteNotReversableException $e) {
         self::assertEquals("The route with name 'no-reverse' is of the 'testRegexpRoute' class, which does not support reversed route generation.", $e->getMessage());
     }
     try {
         $foo = $router->generateUrl('catchall');
         self::fail('Expected exception not thrown.');
     } catch (ezcMvcNamedRouteNotReversableException $e) {
         self::assertEquals("The route with name 'catchall' is of the 'ezcMvcCatchAllRoute' class, which does not support reversed route generation.", $e->getMessage());
     }
 }