- Timestamp:
- 08/05/2014 10:40:49 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/notifications/functions.php
r8176 r8761 121 121 $this->assertEquals( 0, $n ); 122 122 } 123 124 /** 125 * @group bp_has_notifications 126 */ 127 public function test_bp_has_notifications_filtering() { 128 $u1 = $this->create_user(); 129 $u2 = $this->create_user(); 130 131 // create a mixture of different notifications 132 $n1 = $this->factory->notification->create( array( 133 'component_name' => 'messages', 134 'component_action' => 'new_message', 135 'item_id' => 99, 136 'user_id' => $u2, 137 'secondary_item_id' => $u1, 138 'is_new' => true, 139 ) ); 140 141 $n2 = $this->factory->notification->create( array( 142 'component_name' => 'activity', 143 'component_action' => 'new_at_mention', 144 'item_id' => 99, 145 'user_id' => $u2, 146 'secondary_item_id' => $u1, 147 'is_new' => true, 148 ) ); 149 150 $n3 = $this->factory->notification->create( array( 151 'component_name' => 'activity', 152 'component_action' => 'new_at_mention', 153 'item_id' => 100, 154 'user_id' => $u2, 155 'secondary_item_id' => $u1, 156 'is_new' => true, 157 ) ); 158 159 // now fetch only activity notifications 160 bp_has_notifications( array( 161 'component_name' => 'activity', 162 ) ); 163 164 // assert 165 $this->assertEquals( 2, buddypress()->notifications->query_loop->total_notification_count ); 166 } 123 167 }
Note: See TracChangeset
for help on using the changeset viewer.