@@ -51,7 +51,12 @@ public function testMatch()
51
51
->method ('getDefaults ' )
52
52
->will ($ this ->returnValue (array ('foo ' => 'bar ' )))
53
53
;
54
+ $ this ->routeDocument ->expects ($ this ->any ())
55
+ ->method ('getRouteKey ' )
56
+ ->will ($ this ->returnValue ('/routes/company/more ' ))
57
+ ;
54
58
59
+ // add some other routes to the collection
55
60
$ mockCompiled = $ this ->buildMock ('Symfony \\Component \\Routing \\CompiledRoute ' );
56
61
$ mockCompiled ->expects ($ this ->any ())
57
62
->method ('getStaticPrefix ' )
@@ -62,15 +67,17 @@ public function testMatch()
62
67
->method ('compile ' )
63
68
->will ($ this ->returnValue ($ mockCompiled ))
64
69
;
70
+
65
71
$ routeCollection = new RouteCollection ();
66
72
$ routeCollection ->add ('some ' , $ mockRoute );
67
73
$ routeCollection ->add ('_company_more ' , $ this ->routeDocument );
68
74
$ routeCollection ->add ('other ' , $ mockRoute );
69
75
70
76
$ results = $ this ->matcher ->finalMatch ($ routeCollection , $ this ->request );
71
77
78
+ // the matched route returns a key
72
79
$ expected = array (
73
- RouteObjectInterface::ROUTE_NAME => '_company_more ' ,
80
+ RouteObjectInterface::ROUTE_NAME => '/routes/company/more ' ,
74
81
RouteObjectInterface::ROUTE_OBJECT => $ this ->routeDocument ,
75
82
'foo ' => 'bar ' ,
76
83
);
@@ -118,6 +125,7 @@ public function testMatchNoRouteObject()
118
125
119
126
$ results = $ this ->matcher ->finalMatch ($ routeCollection , $ this ->request );
120
127
128
+ // the matched route does not return a key
121
129
$ expected = array (
122
130
RouteObjectInterface::ROUTE_NAME => '_company_more ' ,
123
131
RouteObjectInterface::ROUTE_OBJECT => $ this ->routeDocument ,
0 commit comments