[Routing] Allow spaces in the script name for the apache dumper

This commit is contained in:
Victor Berchet 2012-04-10 14:53:59 +02:00
parent 6465a6987a
commit 77185e0998
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,7 @@
# skip "real" requests
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .* - [QSA,L]
# foo
RewriteCond %{REQUEST_URI} ^/foo$
RewriteRule .* ap\ p_d\ ev.php [QSA,L,E=_ROUTING__route:foo]

View File

@ -34,7 +34,7 @@ class ApacheMatcherDumperTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider provideEscapeFixtures
*/
public function testEscape($src, $dest, $char, $with, $message)
public function testEscapePattern($src, $dest, $char, $with, $message)
{
$r = new \ReflectionMethod(new ApacheMatcherDumper($this->getRouteCollection()), 'escape');
$r->setAccessible(true);
@ -52,6 +52,14 @@ class ApacheMatcherDumperTest extends \PHPUnit_Framework_TestCase
);
}
public function testEscapeScriptName()
{
$collection = new RouteCollection();
$collection->add('foo', new Route('/foo'));
$dumper = new ApacheMatcherDumper($collection);
$this->assertStringEqualsFile(self::$fixturesPath.'/dumper/url_matcher2.apache', $dumper->dump(array('script_name' => 'ap p_d\ ev.php')));
}
private function getRouteCollection()
{
$collection = new RouteCollection();