@@ -74,15 +74,12 @@ public function testRelativeUrlWithNullParameter()
74
74
$ this ->assertEquals ('/app.php/testing ' , $ url );
75
75
}
76
76
77
- /**
78
- * @expectedException Symfony\Component\Routing\Exception\InvalidParameterException
79
- */
80
77
public function testRelativeUrlWithNullParameterButNotOptional ()
81
78
{
82
79
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo}/bar ' , array ('foo ' => null )));
83
- // This must raise an exception because the default requirement for "foo" is "[^/]+" which is not met with these params.
84
- // Generating path "/testing//bar" would be wrong as matching this route would fail.
85
- $ this ->getGenerator ( $ routes )-> generate ( ' test ' , array (), false );
80
+ $ url = $ this -> getGenerator ( $ routes )-> generate ( ' test ' , array (), false );
81
+
82
+ $ this ->assertEquals ( ' /app.php/testing//bar ' , $ url );
86
83
}
87
84
88
85
public function testRelativeUrlWithOptionalZeroParameter ()
@@ -93,13 +90,6 @@ public function testRelativeUrlWithOptionalZeroParameter()
93
90
$ this ->assertEquals ('/app.php/testing/0 ' , $ url );
94
91
}
95
92
96
- public function testNotPassedOptionalParameterInBetween ()
97
- {
98
- $ routes = $ this ->getRoutes ('test ' , new Route ('/{slug}/{page} ' , array ('slug ' => 'index ' , 'page ' => 0 )));
99
- $ this ->assertSame ('/app.php/index/1 ' , $ this ->getGenerator ($ routes )->generate ('test ' , array ('page ' => 1 )));
100
- $ this ->assertSame ('/app.php/ ' , $ this ->getGenerator ($ routes )->generate ('test ' ));
101
- }
102
-
103
93
public function testRelativeUrlWithExtraParameters ()
104
94
{
105
95
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing ' ));
@@ -175,15 +165,6 @@ public function testGenerateForRouteWithInvalidOptionalParameter()
175
165
$ this ->getGenerator ($ routes )->generate ('test ' , array ('foo ' => 'bar ' ), true );
176
166
}
177
167
178
- /**
179
- * @expectedException Symfony\Component\Routing\Exception\InvalidParameterException
180
- */
181
- public function testGenerateForRouteWithInvalidParameter ()
182
- {
183
- $ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , array (), array ('foo ' => '1|2 ' )));
184
- $ this ->getGenerator ($ routes )->generate ('test ' , array ('foo ' => '0 ' ), true );
185
- }
186
-
187
168
public function testGenerateForRouteWithInvalidOptionalParameterNonStrict ()
188
169
{
189
170
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , array ('foo ' => '1 ' ), array ('foo ' => 'd+ ' )));
@@ -215,15 +196,6 @@ public function testGenerateForRouteWithInvalidMandatoryParameter()
215
196
$ routes = $ this ->getRoutes ('test ' , new Route ('/testing/{foo} ' , array (), array ('foo ' => 'd+ ' )));
216
197
$ this ->getGenerator ($ routes )->generate ('test ' , array ('foo ' => 'bar ' ), true );
217
198
}
218
-
219
- /**
220
- * @expectedException Symfony\Component\Routing\Exception\InvalidParameterException
221
- */
222
- public function testRequiredParamAndEmptyPassed ()
223
- {
224
- $ routes = $ this ->getRoutes ('test ' , new Route ('/{slug} ' , array (), array ('slug ' => '.+ ' )));
225
- $ this ->getGenerator ($ routes )->generate ('test ' , array ('slug ' => '' ));
226
- }
227
199
228
200
public function testSchemeRequirementDoesNothingIfSameCurrentScheme ()
229
201
{
@@ -257,15 +229,6 @@ public function testWithAnIntegerAsADefaultValue()
257
229
$ this ->assertEquals ('/app.php/foo ' , $ this ->getGenerator ($ routes )->generate ('test ' , array ('default ' => 'foo ' )));
258
230
}
259
231
260
- public function testQueryParamSameAsDefault ()
261
- {
262
- $ routes = $ this ->getRoutes ('test ' , new Route ('/test ' , array ('default ' => 'value ' )));
263
-
264
- $ this ->assertSame ('/app.php/test?default=foo ' , $ this ->getGenerator ($ routes )->generate ('test ' , array ('default ' => 'foo ' )));
265
- $ this ->assertSame ('/app.php/test?default=value ' , $ this ->getGenerator ($ routes )->generate ('test ' , array ('default ' => 'value ' )));
266
- $ this ->assertSame ('/app.php/test ' , $ this ->getGenerator ($ routes )->generate ('test ' ));
267
- }
268
-
269
232
public function testUrlEncoding ()
270
233
{
271
234
// This tests the encoding of reserved characters that are used for delimiting of URI components (defined in RFC 3986)
0 commit comments