aboutsummaryrefslogtreecommitdiffstats
path: root/tests/controller/common_helper_route.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/controller/common_helper_route.php')
-rw-r--r--tests/controller/common_helper_route.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php
index 44e5e12ab0..3c74c16bae 100644
--- a/tests/controller/common_helper_route.php
+++ b/tests/controller/common_helper_route.php
@@ -89,6 +89,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->user = new \phpbb\user($lang, '\phpbb\datetime');;
$container = new phpbb_mock_container_builder();
+ $container->setParameter('core.environment', PHPBB_ENVIRONMENT);
$cache_path = $phpbb_root_path . 'cache/twig';
$context = new \phpbb\template\context();
$loader = new \phpbb\template\twig\loader($this->filesystem, '');
@@ -121,7 +122,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
)
);
- $this->router = new phpbb_mock_router($this->filesystem, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT, $this->extension_manager);
+ $this->router = new phpbb_mock_router($container, $this->filesystem, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT, $this->extension_manager);
$this->router->find_routing_files($this->extension_manager->all_enabled(false));
$this->router->find(dirname(__FILE__) . '/');
// Set correct current phpBB root path
@@ -155,6 +156,9 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
array('controller2', array(), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
+
+ // Resolves DI parameters
+ array('controller4', array(), true, false, '/' . $this->path_to_app() . 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
);
}
@@ -195,6 +199,9 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
array('controller2', array(), true, false, '/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, '/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
+
+ // Resolves DI parameters
+ array('controller4', array(), true, false, '/' . $this->path_to_app() . 'foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
);
}
@@ -235,6 +242,9 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
array('controller2', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
+
+ // Resolves DI parameters
+ array('controller4', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
);
}
@@ -275,6 +285,9 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
array('controller2', array(), true, false, 'app.php/foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, 'app.php/foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, 'app.php/foo/bar/p-3', 'no params using empty array'),
+
+ // Resolves DI parameters
+ array('controller4', array(), true, false, 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
);
}
@@ -315,6 +328,9 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
array('controller2', array(), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
+
+ // Resolves DI parameters
+ array('controller4', array(), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
);
}
@@ -355,6 +371,9 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
array('controller2', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
+
+ // Resolves DI parameters
+ array('controller4', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
);
}
@@ -435,6 +454,9 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
array('controller2', array(), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
+
+ // Resolves DI parameters
+ array('controller4', array(), true, false, '//localhost/' . $this->path_to_app() . 'foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
);
}