aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2014-09-13 13:02:50 +0800
committerrxu <rxu@mail.ru>2014-10-01 20:55:07 +0800
commitce4035fdd35545638e3bdbeea8f50f5f1de0c943 (patch)
tree4378927791c78a2ff1366b5a874e6d2d667d1982 /tests
parent84e68b3a73183322e970df39b7bd9d1afd37be8a (diff)
downloadforums-ce4035fdd35545638e3bdbeea8f50f5f1de0c943.tar
forums-ce4035fdd35545638e3bdbeea8f50f5f1de0c943.tar.gz
forums-ce4035fdd35545638e3bdbeea8f50f5f1de0c943.tar.bz2
forums-ce4035fdd35545638e3bdbeea8f50f5f1de0c943.tar.xz
forums-ce4035fdd35545638e3bdbeea8f50f5f1de0c943.zip
[ticket/13059] Add core event to generate_page_link()
Add core event to generate_page_link() to allow overriding/modifying pagination URLs. Event request: http://area51.phpbb.com/phpBB/viewtopic.php?f=111&t=45905 PHPBB3-13059
Diffstat (limited to 'tests')
-rw-r--r--tests/mock/event_dispatcher.php13
-rw-r--r--tests/pagination/pagination_test.php4
2 files changed, 13 insertions, 4 deletions
diff --git a/tests/mock/event_dispatcher.php b/tests/mock/event_dispatcher.php
index 613551bffd..fa8b4a1036 100644
--- a/tests/mock/event_dispatcher.php
+++ b/tests/mock/event_dispatcher.php
@@ -11,9 +11,18 @@
*
*/
-class phpbb_mock_event_dispatcher
+class phpbb_mock_event_dispatcher extends \phpbb\event\dispatcher
{
- public function trigger_event($eventName, $data)
+ /**
+ * Constructor.
+ *
+ * Overwrite the constructor to get rid of ContainerInterface param instance
+ */
+ public function __construct()
+ {
+ }
+
+ public function trigger_event($eventName, $data = array())
{
return array();
}
diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php
index 95856dd07d..d36aa11a8a 100644
--- a/tests/pagination/pagination_test.php
+++ b/tests/pagination/pagination_test.php
@@ -28,7 +28,7 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
global $phpbb_dispatcher;
- $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
$this->user->expects($this->any())
->method('lang')
@@ -58,7 +58,7 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
);
$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $provider, $manager, $symfony_request, $filesystem, '', 'php', dirname(__FILE__) . '/');
- $this->pagination = new \phpbb\pagination($this->template, $this->user, $this->helper);
+ $this->pagination = new \phpbb\pagination($this->template, $this->user, $this->helper, $phpbb_dispatcher);
}
public function generate_template_pagination_data()