From ce4035fdd35545638e3bdbeea8f50f5f1de0c943 Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 13 Sep 2014 13:02:50 +0800 Subject: [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 --- tests/mock/event_dispatcher.php | 13 +++++++++++-- tests/pagination/pagination_test.php | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'tests') 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() -- cgit v1.2.1