From d83025387636487163a96d37336be89885e452a0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 23 Sep 2011 20:56:18 +0200 Subject: [PATCH] [Routing] fixed unit tests broken by previous merge --- .../Routing/Fixtures/dumper/url_matcher1.php | 28 +++++++++---------- .../Routing/Fixtures/dumper/url_matcher2.php | 28 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php b/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php index ddbb80d4a6c0..bfd8f8e0f07c 100644 --- a/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php +++ b/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php @@ -26,12 +26,12 @@ public function match($pathinfo) $pathinfo = urldecode($pathinfo); // foo - if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?Pbaz|symfony)$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?Pbaz|symfony)$#xs', $pathinfo, $matches)) { return array_merge($this->mergeDefaults($matches, array ( 'def' => 'test',)), array('_route' => 'foo')); } // bar - if (0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?P[^/]+?)$#xs', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_bar; @@ -42,7 +42,7 @@ public function match($pathinfo) not_bar: // barhead - if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P[^/]+?)$#xs', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_barhead; @@ -68,13 +68,13 @@ public function match($pathinfo) } // baz4 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/$#xs', $pathinfo, $matches)) { $matches['_route'] = 'baz4'; return $matches; } // baz5 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/$#xs', $pathinfo, $matches)) { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_baz5; @@ -85,7 +85,7 @@ public function match($pathinfo) not_baz5: // baz.baz6 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/$#xs', $pathinfo, $matches)) { if ($this->context->getMethod() != 'PUT') { $allow[] = 'PUT'; goto not_bazbaz6; @@ -101,7 +101,7 @@ public function match($pathinfo) } // quoter - if (preg_match('#^/(?P[\']+)$#x', $pathinfo, $matches)) { + if (preg_match('#^/(?P[\']+)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'quoter'; return $matches; } @@ -109,25 +109,25 @@ public function match($pathinfo) if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a/b\'b')) { // foo - if (preg_match('#^/a/b\'b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'foo'; return $matches; } // bar - if (preg_match('#^/a/b\'b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'bar'; return $matches; } // foo1 - if (preg_match('#^/a/b\'b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'foo1'; return $matches; } // bar1 - if (preg_match('#^/a/b\'b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'bar1'; return $matches; } @@ -140,7 +140,7 @@ public function match($pathinfo) } // foo - if (preg_match('#^/aba/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/aba/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'foo'; return $matches; } @@ -148,13 +148,13 @@ public function match($pathinfo) } // foo - if (preg_match('#^/(?P<_locale>[^/]+?)/b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/(?P<_locale>[^/]+?)/b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'foo'; return $matches; } // bar - if (preg_match('#^/(?P<_locale>[^/]+?)/b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/(?P<_locale>[^/]+?)/b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'bar'; return $matches; } diff --git a/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher2.php b/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher2.php index a69f3b2bd7eb..e8ff94dc9716 100644 --- a/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher2.php +++ b/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher2.php @@ -26,12 +26,12 @@ public function match($pathinfo) $pathinfo = urldecode($pathinfo); // foo - if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?Pbaz|symfony)$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?Pbaz|symfony)$#xs', $pathinfo, $matches)) { return array_merge($this->mergeDefaults($matches, array ( 'def' => 'test',)), array('_route' => 'foo')); } // bar - if (0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?P[^/]+?)$#xs', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_bar; @@ -42,7 +42,7 @@ public function match($pathinfo) not_bar: // barhead - if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P[^/]+?)$#xs', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_barhead; @@ -71,7 +71,7 @@ public function match($pathinfo) } // baz4 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/?$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/?$#xs', $pathinfo, $matches)) { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'baz4'); } @@ -80,7 +80,7 @@ public function match($pathinfo) } // baz5 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/?$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/?$#xs', $pathinfo, $matches)) { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_baz5; @@ -94,7 +94,7 @@ public function match($pathinfo) not_baz5: // baz.baz6 - if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/?$#x', $pathinfo, $matches)) { + if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P[^/]+?)/?$#xs', $pathinfo, $matches)) { if ($this->context->getMethod() != 'PUT') { $allow[] = 'PUT'; goto not_bazbaz6; @@ -113,7 +113,7 @@ public function match($pathinfo) } // quoter - if (preg_match('#^/(?P[\']+)$#x', $pathinfo, $matches)) { + if (preg_match('#^/(?P[\']+)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'quoter'; return $matches; } @@ -121,25 +121,25 @@ public function match($pathinfo) if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a/b\'b')) { // foo - if (preg_match('#^/a/b\'b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'foo'; return $matches; } // bar - if (preg_match('#^/a/b\'b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'bar'; return $matches; } // foo1 - if (preg_match('#^/a/b\'b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'foo1'; return $matches; } // bar1 - if (preg_match('#^/a/b\'b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/a/b\'b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'bar1'; return $matches; } @@ -152,7 +152,7 @@ public function match($pathinfo) } // foo - if (preg_match('#^/aba/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/aba/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'foo'; return $matches; } @@ -160,13 +160,13 @@ public function match($pathinfo) } // foo - if (preg_match('#^/(?P<_locale>[^/]+?)/b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/(?P<_locale>[^/]+?)/b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'foo'; return $matches; } // bar - if (preg_match('#^/(?P<_locale>[^/]+?)/b/(?P[^/]+?)$#x', $pathinfo, $matches)) { + if (preg_match('#^/(?P<_locale>[^/]+?)/b/(?P[^/]+?)$#xs', $pathinfo, $matches)) { $matches['_route'] = 'bar'; return $matches; }