@@ -120,7 +120,7 @@ public function testGenerateRouteMultilang()
120
120
$ this ->assertEquals ('result_url ' , $ this ->generator ->generate ($ route_en , array ('_locale ' => 'de ' )));
121
121
}
122
122
123
- public function testGenerateRouteMultilangNomatch ()
123
+ public function testGenerateRouteMultilangLocaleNomatch ()
124
124
{
125
125
$ route_en = $ this ->buildMock ('Symfony \\Cmf \\Component \\Routing \\Tests \\Routing \\RouteMock ' , array ('getDefaults ' , 'compile ' , 'getRouteContent ' ));
126
126
$ route_en ->setLocale ('en ' );
@@ -228,6 +228,28 @@ public function testGenerateDocumentMultilang()
228
228
$ this ->assertEquals ('result_url ' , $ this ->generator ->generate ($ this ->contentDocument , array ('_locale ' => 'de ' )));
229
229
}
230
230
231
+ public function testGenerateDocumentMultilangLocaleNomatch ()
232
+ {
233
+ $ route_en = $ this ->buildMock ('Symfony \\Cmf \\Component \\Routing \\Tests \\Routing \\RouteMock ' , array ('getDefaults ' , 'compile ' ));
234
+ $ route_en ->setLocale ('en ' );
235
+ $ route_de = $ this ->routeDocument ;
236
+ $ route_de ->setLocale ('de ' );
237
+
238
+ $ this ->contentDocument ->expects ($ this ->once ())
239
+ ->method ('getRoutes ' )
240
+ ->will ($ this ->returnValue (array ($ route_en , $ route_de )))
241
+ ;
242
+ $ route_en ->expects ($ this ->once ())
243
+ ->method ('compile ' )
244
+ ->will ($ this ->returnValue ($ this ->routeCompiled ))
245
+ ;
246
+ $ route_de ->expects ($ this ->never ())
247
+ ->method ('compile ' )
248
+ ;
249
+
250
+ $ this ->assertEquals ('result_url ' , $ this ->generator ->generate ($ this ->contentDocument , array ('_locale ' => 'fr ' )));
251
+ }
252
+
231
253
/**
232
254
* @expectedException Symfony\Component\Routing\Exception\RouteNotFoundException
233
255
*/
0 commit comments