aboutsummaryrefslogtreecommitdiffstats
path: root/tests/notification/group_request_test.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-07-27 19:31:31 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-07-27 19:31:31 -0500
commit359aedf664b41d553665d62243d7943293b79d96 (patch)
tree07b023aaac0db7ab6331482ac4c7110cd61424f0 /tests/notification/group_request_test.php
parentb213be84a7ff0f947de0025dcc4620142edf226b (diff)
downloadforums-359aedf664b41d553665d62243d7943293b79d96.tar
forums-359aedf664b41d553665d62243d7943293b79d96.tar.gz
forums-359aedf664b41d553665d62243d7943293b79d96.tar.bz2
forums-359aedf664b41d553665d62243d7943293b79d96.tar.xz
forums-359aedf664b41d553665d62243d7943293b79d96.zip
[ticket/11744] Helper function to assert notifications in base test
This also fixes tests PHPBB3-11744
Diffstat (limited to 'tests/notification/group_request_test.php')
-rw-r--r--tests/notification/group_request_test.php43
1 files changed, 15 insertions, 28 deletions
diff --git a/tests/notification/group_request_test.php b/tests/notification/group_request_test.php
index d61c4adf38..3606a6455c 100644
--- a/tests/notification/group_request_test.php
+++ b/tests/notification/group_request_test.php
@@ -53,41 +53,28 @@ class phpbb_notification_group_request_test extends phpbb_tests_notification_bas
$group_id = false;
group_create($group_id, GROUP_OPEN, 'test', 'test group', array());
- // Add user 1 as group leader
+ // Add user 2 as group leader
group_user_add($group_id, 2, false, false, false, true, false);
- // Add user 2 as pending
+ // Add user 3 as pending
group_user_add($group_id, 3, false, false, false, false, true);
- $notifications = $this->notifications->load_notifications(array(
- 'count_unread' => true,
- 'user_id' => 2,
- ));
-
- $expected = array(
+ $this->assert_notifications(
array(
- 'item_id' => 3, // user_id of requesting join
- 'item_parent_id' => $group_id,
- 'user_id' => 2,
- 'notification_read' => 0,
- 'notification_data' => array(
- 'group_name' => 'test',
+ // user 3 pending notification
+ array(
+ 'item_id' => 3, // user_id of requesting join
+ 'item_parent_id' => $group_id,
+ 'user_id' => 2,
+ 'notification_read' => 0,
+ 'notification_data' => array(
+ 'group_name' => 'test',
+ ),
),
),
+ array(
+ 'user_id' => 2,
+ )
);
-
- $this->assertEquals(sizeof($expected), $notifications['unread_count']);
-
- $i = 0;
- foreach ($notifications['notifications'] as $notification)
- {
- foreach ($expected[$i] as $notification_data)
- {
- $this->assertEquals($value, $notification->$key, $key . ' ' . $i);
- }
-
- $i++;
- }
-
}
}