diff options
author | Vjacheslav Trushkin <arty@phpbb.com> | 2012-03-31 10:43:06 +0300 |
---|---|---|
committer | Vjacheslav Trushkin <arty@phpbb.com> | 2012-03-31 10:43:06 +0300 |
commit | 398a6c8045113f14900bdea8c70ba032f75b45f6 (patch) | |
tree | 1a9ff30f5eeca6faf0adbd314b60caf1869079c5 /tests | |
parent | 506951e8aff98582ebc56fcda9ed0626497ade77 (diff) | |
parent | 013a8649a5164b90310e76d99fae2186b831a5f0 (diff) | |
download | forums-398a6c8045113f14900bdea8c70ba032f75b45f6.tar forums-398a6c8045113f14900bdea8c70ba032f75b45f6.tar.gz forums-398a6c8045113f14900bdea8c70ba032f75b45f6.tar.bz2 forums-398a6c8045113f14900bdea8c70ba032f75b45f6.tar.xz forums-398a6c8045113f14900bdea8c70ba032f75b45f6.zip |
Merge branch 'develop' into feature/merging-style-components
* develop: (175 commits)
[feature/ajax] Remove strange non-breaking spaces from approve button
[feature/ajax] Add entirely unrelated but nice newlines
[feature/ajax] Unify phpbb_json_response instantiation
[feature/ajax] Fix acp_styles activate_deactivate ajax callback name
[feature/ajax] Send correct activate/deactivate JSON response in acp_profile
[ticket/10270] Alter background colors for posts
[feature/ajax] Remove not working module enable/disable ajax code
[feature/ajax] Replace static call to phpbb_request with OO
[feature/ajax] Remove quick-reply AJAX handling until we have something good
[ticket/10270] Changing close button for ajax popups
[ticket/10270] Disabling links in disappearing content
[ticket/10291] Fixed an AJAX bug on quick reply form submit.
[ticket/10273] Fixed accepting / denying posts AJAX.
[ticket/10272] Removed code that was prevent event propogation in AJAX.
[ticket/10291] Fixed a bug in the quick reply AJAX.
[feature/ajax] Handle acp_modules error cases with JSON response
[feature/ajax] Fix filter check, quick mod tools data-attribute
[feature/ajax] Use the error handler
[feature/ajax] Generic error handling with a phpbb.alert box
[feature/ajax] Change filter semantics, some minor adjustments
...
Conflicts:
phpBB/adm/style/acp_styles.html
phpBB/includes/acp/acp_styles.php
Diffstat (limited to 'tests')
6 files changed, 38 insertions, 23 deletions
diff --git a/tests/event/dispatcher_test.php b/tests/event/dispatcher_test.php new file mode 100644 index 0000000000..f8fe060d99 --- /dev/null +++ b/tests/event/dispatcher_test.php @@ -0,0 +1,29 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class phpbb_event_dispatcher_test extends phpbb_test_case +{ + public function test_trigger_event() + { + $dispatcher = new phpbb_event_dispatcher(); + + $dispatcher->addListener('core.test_event', function (phpbb_event_data $event) { + $event['foo'] = $event['foo'] . '2'; + $event['bar'] = $event['bar'] . '2'; + }); + + $foo = 'foo'; + $bar = 'bar'; + + $vars = array('foo', 'bar'); + $result = $dispatcher->trigger_event('core.test_event', compact($vars)); + + $this->assertSame(array('foo' => 'foo2', 'bar' => 'bar2'), $result); + } +} diff --git a/tests/functional/fixtures/ext/error/class/controller.php b/tests/functional/fixtures/ext/error/class/controller.php index eb2ae362a6..74bbbee540 100644 --- a/tests/functional/fixtures/ext/error/class/controller.php +++ b/tests/functional/fixtures/ext/error/class/controller.php @@ -1,13 +1,10 @@ <?php -class phpbb_ext_foobar_controller implements phpbb_extension_controller_interface +class phpbb_ext_foobar_controller extends phpbb_extension_controller { public function handle() { - global $template; - $template->set_ext_dir_prefix($phpbb_root_path . 'ext/error/class/'); - - $template->set_filenames(array( + $this->template->set_filenames(array( 'body' => 'index_body.html' )); diff --git a/tests/functional/fixtures/ext/error/classtype/controller.php b/tests/functional/fixtures/ext/error/classtype/controller.php index 2276548b55..55ac651bdf 100644 --- a/tests/functional/fixtures/ext/error/classtype/controller.php +++ b/tests/functional/fixtures/ext/error/classtype/controller.php @@ -5,8 +5,6 @@ class phpbb_ext_error_classtype_controller public function handle() { global $template; - $template->set_ext_dir_prefix($phpbb_root_path . 'ext/error/classtype/'); - $template->set_filenames(array( 'body' => 'index_body.html' )); diff --git a/tests/functional/fixtures/ext/error/disabled/controller.php b/tests/functional/fixtures/ext/error/disabled/controller.php index b83a949020..57b913f377 100644 --- a/tests/functional/fixtures/ext/error/disabled/controller.php +++ b/tests/functional/fixtures/ext/error/disabled/controller.php @@ -1,13 +1,10 @@ <?php -class phpbb_ext_error_disabled_controller implements phpbb_extension_controller_interface +class phpbb_ext_error_disabled_controller extends phpbb_extension_controller { public function handle() - { - global $template; - $template->set_ext_dir_prefix($phpbb_root_path . 'ext/error/disabled/'); - - $template->set_filenames(array( + { + $this->template->set_filenames(array( 'body' => 'index_body.html' )); diff --git a/tests/functional/fixtures/ext/foo/bar/controller.php b/tests/functional/fixtures/ext/foo/bar/controller.php index 24d218c412..3375e317b3 100644 --- a/tests/functional/fixtures/ext/foo/bar/controller.php +++ b/tests/functional/fixtures/ext/foo/bar/controller.php @@ -1,13 +1,10 @@ <?php -class phpbb_ext_foo_bar_controller implements phpbb_extension_controller_interface +class phpbb_ext_foo_bar_controller extends phpbb_extension_controller { public function handle() { - global $template; - $template->set_ext_dir_prefix($phpbb_root_path . 'ext/foo/bar/'); - - $template->set_filenames(array( + $this->template->set_filenames(array( 'body' => 'foobar_body.html' )); diff --git a/tests/functional/fixtures/ext/foobar/controller.php b/tests/functional/fixtures/ext/foobar/controller.php index bf8d8139ae..ff35f12ee0 100644 --- a/tests/functional/fixtures/ext/foobar/controller.php +++ b/tests/functional/fixtures/ext/foobar/controller.php @@ -1,13 +1,10 @@ <?php -class phpbb_ext_foobar_controller implements phpbb_extension_controller_interface +class phpbb_ext_foobar_controller extends phpbb_extension_controller { public function handle() { - global $template; - $template->set_ext_dir_prefix($phpbb_root_path . 'ext/foobar/'); - - $template->set_filenames(array( + $this->template->set_filenames(array( 'body' => 'foobar_body.html' )); |