File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed
Tests/Functional/Doctrine/Phpcr Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 11Changelog
22=========
33
4+ * ** 2014-08-07** : PHPCR RouteProvider no longer allows colons in the URI as they are
5+ interpreted as namespaces, leading to errors.
46* ** 2014-06-06** : Updated to PSR-4 autoloading
57
681.2.0
Original file line number Diff line number Diff line change @@ -59,6 +59,20 @@ public function __construct(
5959 $ this ->logger = $ logger ;
6060 }
6161
62+ /**
63+ * @param Request $request
64+ *
65+ * @return array a list of PHPCR-ODM ids
66+ */
67+ public function getCandidates (Request $ request )
68+ {
69+ if (false !== strpos ($ request ->getPathInfo (), ': ' )) {
70+ return array ();
71+ }
72+
73+ return $ this ->candidatesStrategy ->getCandidates ($ request );
74+ }
75+
6276 /**
6377 * {@inheritDoc}
6478 *
@@ -69,7 +83,7 @@ public function __construct(
6983 */
7084 public function getRouteCollectionForRequest (Request $ request )
7185 {
72- $ candidates = $ this ->candidatesStrategy -> getCandidates ($ request );
86+ $ candidates = $ this ->getCandidates ($ request );
7387
7488 $ collection = new RouteCollection ();
7589
Original file line number Diff line number Diff line change @@ -101,16 +101,26 @@ public function testGetRouteCollectionForRequestFormat()
101101 /**
102102 * The root route will always be found.
103103 */
104- public function testGetRouteCollectionForRequestNophpcrUrl ()
104+ public function testGetRouteCollectionForRequestNonPhpcrUrl ()
105105 {
106- $ collection = $ this ->repository ->getRouteCollectionForRequest (Request::create (':/// ' ));
106+ $ collection = $ this ->repository ->getRouteCollectionForRequest (Request::create ('http :/// ' ));
107107 $ this ->assertInstanceOf ('Symfony\Component\Routing\RouteCollection ' , $ collection );
108108 $ this ->assertCount (1 , $ collection );
109109 $ routes = $ collection ->all ();
110110 list ($ key , $ route ) = each ($ routes );
111111 $ this ->assertEquals (self ::ROUTE_ROOT , $ key );
112112 }
113113
114+ /**
115+ * The root route will always be found.
116+ */
117+ public function testGetRouteCollectionForRequestColonInUrl ()
118+ {
119+ $ collection = $ this ->repository ->getRouteCollectionForRequest (Request::create ('http://foo.com/jcr:content ' ));
120+ $ this ->assertInstanceOf ('Symfony\Component\Routing\RouteCollection ' , $ collection );
121+ $ this ->assertCount (0 , $ collection );
122+ }
123+
114124 public function testGetRoutesByNames ()
115125 {
116126 $ this ->buildRoutes ();
You can’t perform that action at this time.
0 commit comments