8000 [Routing] added test for disabled requirements check · sunqipenglib/symfony@5f64503 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5f64503

Browse files
committed
[Routing] added test for disabled requirements check
1 parent 4225869 commit 5f64503

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ public function testGenerateForRouteWithInvalidOptionalParameterNonStrictWithLog
207207
$this->assertNull($generator->generate('test', array('foo' => 'bar'), true));
208208
}
209209

210+
public function testGenerateForRouteWithInvalidParameterButDisabledRequirementsCheck()
211+
{
212+
$routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+')));
213+
$generator = $this->getGenerator($routes);
214+
$generator->setStrictRequirements(null);
215+
$this->assertSame('/app.php/testing/bar', $generator->generate('test', array('foo' => 'bar')));
216+
}
217+
210218
/**
211219
* @expectedException Symfony\Component\Routing\Exception\InvalidParameterException
212220
*/

0 commit comments

Comments
 (0)
0