aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-06-14 00:16:52 +0200
committerAndreas Fischer <bantu@phpbb.com>2014-06-14 00:16:52 +0200
commit7642fbbd63e70c55a033503a428a6b206a29efdf (patch)
tree711598c2a8a8d1b0d6b86cc1768be030bd941d3c /tests
parent99c3ca18be101ee414125335dee34dbf952fd05d (diff)
parentf5415619ebc49e370a4ec06cd6b664fb2456ccfe (diff)
downloadforums-7642fbbd63e70c55a033503a428a6b206a29efdf.tar
forums-7642fbbd63e70c55a033503a428a6b206a29efdf.tar.gz
forums-7642fbbd63e70c55a033503a428a6b206a29efdf.tar.bz2
forums-7642fbbd63e70c55a033503a428a6b206a29efdf.tar.xz
forums-7642fbbd63e70c55a033503a428a6b206a29efdf.zip
Merge pull request #2527 from dhruvgoel92/ticket/11445
[ticket/11445] optimize no of queries in get_global_subscriptions( ) * dhruvgoel92/ticket/11445: [ticket/11445] Move get user's notification code into its own method [ticket/11445] Remove unused foreach key $group_name [ticket/11445] Improve unit tests for get_global_subscriptions [ticket/11445] Optimize no of queries in get_global_subscriptions
Diffstat (limited to 'tests')
-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));