Changeset 9570 for trunk/tests/phpunit/testcases/notifications/class-bp-notifications-notification.php
- Timestamp:
- 03/01/2015 01:34:15 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/notifications/class-bp-notifications-notification.php
r9139 r9570 280 280 $this->assertEquals( $expected, $actual ); 281 281 } 282 283 /** 284 * @group pagination 285 * @group BP6229 286 */ 287 public function test_get_paged_sql() { 288 $u = $this->factory->user->create(); 289 290 $notifications = array(); 291 for ( $i = 1; $i <= 6; $i++ ) { 292 $notifications[] = $this->factory->notification->create( array( 293 'component_name' => 'activity', 294 'secondary_item_id' => $i, 295 'user_id' => $u, 296 'is_new' => true, 297 ) ); 298 } 299 300 $found = BP_Notifications_Notification::get( array( 301 'user_id' => $u, 302 'is_new' => true, 303 'page' => 2, 304 'per_page' => 2, 305 'order_by' => 'id', 306 ) ); 307 308 // Check that the correct number of items are pulled up 309 $expected = array( $notifications[2], $notifications[3] ); 310 $this->assertEquals( $expected, wp_list_pluck( $found, 'id' ) ); 311 } 282 312 }
Note: See TracChangeset
for help on using the changeset viewer.