From f5f3dd7878f73585de83022b708c4de4f3d7f0f9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 14 Dec 2017 11:33:46 -0800 Subject: [PATCH] [Routing] fixed tests --- .../Tests/Fixtures/dumper/url_matcher4.php | 4 ++-- .../Tests/Fixtures/dumper/url_matcher5.php | 22 +++++++++---------- .../Tests/Fixtures/dumper/url_matcher6.php | 4 ++-- .../Tests/Fixtures/dumper/url_matcher7.php | 16 +++++++------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php index 6aefd69382..50da489fb2 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php @@ -15,10 +15,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher $this->context = $context; } - public function match($pathinfo) + public function match($rawPathinfo) { $allow = array(); - $pathinfo = rawurldecode($pathinfo); + $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; $request = $this->request; diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php index 1884df1c45..14c5f5bdf9 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php @@ -15,10 +15,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $this->context = $context; } - public function match($pathinfo) + public function match($rawPathinfo) { $allow = array(); - $pathinfo = rawurldecode($pathinfo); + $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; $request = $this->request; @@ -57,7 +57,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // a_fourth if ('/a/44' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'a_fourth'); + return $this->redirect($rawPathinfo.'/', 'a_fourth'); } return array('_route' => 'a_fourth'); @@ -66,7 +66,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // a_fifth if ('/a/55' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'a_fifth'); + return $this->redirect($rawPathinfo.'/', 'a_fifth'); } return array('_route' => 'a_fifth'); @@ -75,7 +75,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // a_sixth if ('/a/66' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'a_sixth'); + return $this->redirect($rawPathinfo.'/', 'a_sixth'); } return array('_route' => 'a_sixth'); @@ -92,7 +92,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // nested_a if ('/nested/group/a' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'nested_a'); + return $this->redirect($rawPathinfo.'/', 'nested_a'); } return array('_route' => 'nested_a'); @@ -101,7 +101,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // nested_b if ('/nested/group/b' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'nested_b'); + return $this->redirect($rawPathinfo.'/', 'nested_b'); } return array('_route' => 'nested_b'); @@ -110,7 +110,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // nested_c if ('/nested/group/c' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'nested_c'); + return $this->redirect($rawPathinfo.'/', 'nested_c'); } return array('_route' => 'nested_c'); @@ -122,7 +122,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // slashed_a if ('/slashed/group' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'slashed_a'); + return $this->redirect($rawPathinfo.'/', 'slashed_a'); } return array('_route' => 'slashed_a'); @@ -131,7 +131,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // slashed_b if ('/slashed/group/b' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'slashed_b'); + return $this->redirect($rawPathinfo.'/', 'slashed_b'); } return array('_route' => 'slashed_b'); @@ -140,7 +140,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // slashed_c if ('/slashed/group/c' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'slashed_c'); + return $this->redirect($rawPathinfo.'/', 'slashed_c'); } return array('_route' => 'slashed_c'); diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php index bb9d80b551..933525699c 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php @@ -15,10 +15,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher $this->context = $context; } - public function match($pathinfo) + public function match($rawPathinfo) { $allow = array(); - $pathinfo = rawurldecode($pathinfo); + $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; $request = $this->request; diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php index 404d462ed5..3306bb124e 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php @@ -15,10 +15,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $this->context = $context; } - public function match($pathinfo) + public function match($rawPathinfo) { $allow = array(); - $pathinfo = rawurldecode($pathinfo); + $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; $request = $this->request; @@ -34,7 +34,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // simple_trailing_slash_no_methods if ('/trailing/simple/no-methods' === $trimmedPathinfo) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'simple_trailing_slash_no_methods'); + return $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_no_methods'); } return array('_route' => 'simple_trailing_slash_no_methods'); @@ -48,7 +48,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec } if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'simple_trailing_slash_GET_method'); + return $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_GET_method'); } return array('_route' => 'simple_trailing_slash_GET_method'); @@ -63,7 +63,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec } if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'simple_trailing_slash_HEAD_method'); + return $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_HEAD_method'); } return array('_route' => 'simple_trailing_slash_HEAD_method'); @@ -87,7 +87,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // regex_trailing_slash_no_methods if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P[^/]++)/?$#s', $pathinfo, $matches)) { if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'regex_trailing_slash_no_methods'); + return $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_no_methods'); } return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array ()); @@ -101,7 +101,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec } if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'regex_trailing_slash_GET_method'); + return $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_GET_method'); } return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array ()); @@ -116,7 +116,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec } if (substr($pathinfo, -1) !== '/') { - return $this->redirect($pathinfo.'/', 'regex_trailing_slash_HEAD_method'); + return $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_HEAD_method'); } return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ());