From 400277c03624788e6a31f9aa4a15b883478f58cc Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 24 Mar 2012 15:45:18 +0100 Subject: [feature/event-dispatcher] Change phpbb_event_dispatcher to inheritance, tests PHPBB3-9550 --- tests/event/dispatcher_test.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/event/dispatcher_test.php (limited to 'tests') diff --git a/tests/event/dispatcher_test.php b/tests/event/dispatcher_test.php new file mode 100644 index 0000000000..59e51b1cdc --- /dev/null +++ b/tests/event/dispatcher_test.php @@ -0,0 +1,29 @@ +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); + } +} -- cgit v1.2.1