File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed
Tests/Functional/Doctrine/Phpcr Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
3
4
+ * ** 2014-08-07** : PHPCR RouteProvider no longer allows colons in the URI
4
5
* ** 2014-06-06** : Updated to PSR-4 autoloading
5
6
6
7
1.2.0
Original file line number Diff line number Diff line change @@ -59,6 +59,20 @@ public function __construct(
59
59
$ this ->logger = $ logger ;
60
60
}
61
61
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
+
62
76
/**
63
77
* {@inheritDoc}
64
78
*
@@ -69,7 +83,7 @@ public function __construct(
69
83
*/
70
84
public function getRouteCollectionForRequest (Request $ request )
71
85
{
72
- $ candidates = $ this ->candidatesStrategy -> getCandidates ($ request );
86
+ $ candidates = $ this ->getCandidates ($ request );
73
87
74
88
$ collection = new RouteCollection ();
75
89
Original file line number Diff line number Diff line change @@ -101,16 +101,26 @@ public function testGetRouteCollectionForRequestFormat()
101
101
/**
102
102
* The root route will always be found.
103
103
*/
104
- public function testGetRouteCollectionForRequestNophpcrUrl ()
104
+ public function testGetRouteCollectionForRequestNonPhpcrUrl ()
105
105
{
106
- $ collection = $ this ->repository ->getRouteCollectionForRequest (Request::create (':/// ' ));
106
+ $ collection = $ this ->repository ->getRouteCollectionForRequest (Request::create ('http :/// ' ));
107
107
$ this ->assertInstanceOf ('Symfony\Component\Routing\RouteCollection ' , $ collection );
108
108
$ this ->assertCount (1 , $ collection );
109
109
$ routes = $ collection ->all ();
110
110
list ($ key , $ route ) = each ($ routes );
111
111
$ this ->assertEquals (self ::ROUTE_ROOT , $ key );
112
112
}
113
113
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
+
114
124
public function testGetRoutesByNames ()
115
125
{
116
126
$ this ->buildRoutes ();
You can’t perform that action at this time.
0 commit comments