aboutsummaryrefslogtreecommitdiffstats
path: root/tests/notification
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2014-06-01 13:44:09 +0530
committerDhruv <dhruv.goel92@gmail.com>2014-06-01 13:44:09 +0530
commitc7687ba5aa171b4f9ec964897794695ab72cb069 (patch)
tree490f7cb80ca7b3826f4dc6cea7bea7003f4586e5 /tests/notification
parent572debd0e820bfaa4d55b59eb19544fa245aa579 (diff)
downloadforums-c7687ba5aa171b4f9ec964897794695ab72cb069.tar
forums-c7687ba5aa171b4f9ec964897794695ab72cb069.tar.gz
forums-c7687ba5aa171b4f9ec964897794695ab72cb069.tar.bz2
forums-c7687ba5aa171b4f9ec964897794695ab72cb069.tar.xz
forums-c7687ba5aa171b4f9ec964897794695ab72cb069.zip
[ticket/11445] Improve unit tests for get_global_subscriptions
PHPBB3-11445
Diffstat (limited to 'tests/notification')
-rw-r--r--tests/notification/notification_test.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/notification/notification_test.php b/tests/notification/notification_test.php
index 799dcc5e22..27ea8ddb44 100644
--- a/tests/notification/notification_test.php
+++ b/tests/notification/notification_test.php
@@ -71,6 +71,27 @@ class phpbb_notification_test extends phpbb_tests_notification_base
public function test_subscriptions()
{
+ $expected_subscriptions = array(
+ 'post' => array(''),
+ 'topic' => array(''),
+ 'quote' => array(''),
+ 'bookmark' => array(''),
+ 'test' => array(''),
+ 'pm' => array(''),
+ );
+
+ $subscriptions = $this->notifications->get_global_subscriptions(2);
+
+ foreach ($expected_subscriptions as $item_type => $methods)
+ {
+ $this->assert_array_content_equals($methods, $subscriptions[$item_type]);
+ }
+
+ foreach ($subscriptions as $item_type => $methods)
+ {
+ $this->assert_array_content_equals($methods, $expected_subscriptions[$item_type]);
+ }
+
$this->notifications->delete_subscription('post', 0, '', 2);
$this->assertArrayNotHasKey('post', $this->notifications->get_global_subscriptions(2));