This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
Tests/Unit/AutoRoute/PathProvider Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,17 @@ public function providePath(RouteStack $routeStack)
54
54
throw new \RuntimeException (sprintf ('Method %s:%s must return an instance of DateTime. ' ));
55
55
}
56
56
57
- $ string = $ date ->format ($ this ->dateFormat );
58
- $ pathElements = $ this ->normalizePathElements ($ string );
57
+ $ dateString = $ date ->format ($ this ->dateFormat );
58
+ $ pathElements = $ this ->normalizePathElements ($ dateString );
59
59
60
60
$ routeStack ->addPathElements ($ pathElements );
61
61
}
62
+
63
+ /**
64
+ * {@inheritDoc}
65
+ */
66
+ public function normalizePathElements ($ elements )
67
+ {
68
+ return parent ::normalizePathElements (explode ('/ ' , $ elements ));
69
+ }
62
70
}
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ protected function normalizePathElements($pathElements)
83
83
throw new \RuntimeException ('Path must not be absolute. ' );
84
84
}
85
85
86
- $ pathElements = explode ( ' / ' , $ pathElements );
86
+ $ pathElements = array ( $ pathElements );
87
87
}
88
88
89
89
if (!is_array ($ pathElements )) {
Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ public function testProvideMethodNoSlugify()
97
97
public function testProvideMethodWithString ()
98
98
{
99
99
$ this ->setupTest ();
100
+ $ this ->routeStack ->expects ($ this ->once ())
101
+ ->method ('addPathElements ' )
102
+ ->with (array ('this/is/a/path ' ));
100
103
101
104
$ this ->provider ->init (array ('method ' => 'getStringSlug ' ));
102
105
$ this ->provider ->providePath ($ this ->routeStack );
You can’t perform that action at this time.
0 commit comments