From ecf1e94726a8a1e0f8d30aba3935e1899c2c6adc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 7 Mar 2014 12:42:06 +0100 Subject: [ticket/12090] Change redirect tests to use route() PHPBB3-12090 --- tests/functional/fixtures/ext/foo/bar/config/routing.yml | 12 ++++++++++++ .../fixtures/ext/foo/bar/controller/controller.php | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'tests/functional') diff --git a/tests/functional/fixtures/ext/foo/bar/config/routing.yml b/tests/functional/fixtures/ext/foo/bar/config/routing.yml index 9b1ce3cfd7..d4d256c293 100644 --- a/tests/functional/fixtures/ext/foo/bar/config/routing.yml +++ b/tests/functional/fixtures/ext/foo/bar/config/routing.yml @@ -17,3 +17,15 @@ foo_exception_controller: foo_redirect_controller: pattern: /foo/redirect defaults: { _controller: foo_bar.controller:redirect } + +foo_index_controller: + pattern: /index + defaults: { _controller: foo_bar.controller:redirect } + +foo_tests_index_controller: + pattern: /tests/index + defaults: { _controller: foo_bar.controller:redirect } + +foo_tests_dotdot_index_controller: + pattern: /tests/../index + defaults: { _controller: foo_bar.controller:redirect } diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php index 558b202948..7a52958ab6 100644 --- a/tests/functional/fixtures/ext/foo/bar/controller/controller.php +++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php @@ -63,15 +63,15 @@ class controller 'tests/index.php', ), array( - $this->helper->url('index'), + $this->helper->url('foo_index_controller'), $rewrite_prefix . 'index', ), array( - $this->helper->url('tests/index'), + $this->helper->url('foo_tests_index_controller'), $rewrite_prefix . 'tests/index', ), array( - $this->helper->url('tests/../index'), + $this->helper->url('foo_tests_dotdot_index_controller'), $rewrite_prefix . 'index', ), /* -- cgit v1.2.1 From 6491477809bf6eed1cf4672e4a6439f24cce3b57 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 7 Mar 2014 15:14:35 +0100 Subject: [ticket/12090] Fix helper usage in functional controller tests PHPBB3-12090 --- .../fixtures/ext/foo/bar/controller/controller.php | 30 +++------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'tests/functional') diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php index 7a52958ab6..36f232baec 100644 --- a/tests/functional/fixtures/ext/foo/bar/controller/controller.php +++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php @@ -63,41 +63,17 @@ class controller 'tests/index.php', ), array( - $this->helper->url('foo_index_controller'), + $this->helper->route('foo_index_controller'), $rewrite_prefix . 'index', ), array( - $this->helper->url('foo_tests_index_controller'), + $this->helper->route('foo_tests_index_controller'), $rewrite_prefix . 'tests/index', ), array( - $this->helper->url('foo_tests_dotdot_index_controller'), + $this->helper->route('foo_tests_dotdot_index_controller'), $rewrite_prefix . 'index', ), - /* - // helper URLs starting with ../ are prone to failure. - // Do not test them right now. - array( - $this->helper->url('../index'), - '../index', - ), - array( - $this->helper->url('../../index'), - '../index', - ), - array( - $this->helper->url('../tests/index'), - $rewrite_prefix . '../tests/index', - ), - array( - $this->helper->url('../tests/../index'), - '../index', - ), - array( - $this->helper->url('../../tests/index'), - '../tests/index', - ), - */ ); foreach ($redirects as $redirect) -- cgit v1.2.1 From 0119a21862bc433b50fe3914e3bae6f12f61129c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 9 Mar 2014 19:17:12 +0100 Subject: [ticket/12090] Comment out broken test PHPBB3-12090 --- tests/functional/fixtures/ext/foo/bar/controller/controller.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/functional') diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php index 36f232baec..45246f8a97 100644 --- a/tests/functional/fixtures/ext/foo/bar/controller/controller.php +++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php @@ -70,10 +70,13 @@ class controller $this->helper->route('foo_tests_index_controller'), $rewrite_prefix . 'tests/index', ), + /** + * Symfony does not allow /../ in routes array( $this->helper->route('foo_tests_dotdot_index_controller'), $rewrite_prefix . 'index', ), + */ ); foreach ($redirects as $redirect) -- cgit v1.2.1