Skip to:
Content

BuddyPress.org

Changeset 8507


Ignore:
Timestamp:
06/13/2014 04:18:41 PM (9 years ago)
Author:
boonebgorges
Message:

Add search_terms test for BP_Notifications_Notification::get()

See #5701

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/notifications/class-bp-notifications-notification.php

    r8167 r8507  
    247247        $this->assertEquals( $expected, $actual );
    248248    }
     249
     250    /**
     251     * @group get
     252     * @group search_terms
     253     */
     254    public function test_get_with_search_terms() {
     255        $u = $this->create_user();
     256        $n1 = $this->factory->notification->create( array(
     257            'component_name' => 'friends',
     258            'user_id' => $u,
     259            'is_new' => false,
     260        ) );
     261        $n2 = $this->factory->notification->create( array(
     262            'component_name' => 'groups',
     263            'user_id' => $u,
     264            'is_new' => true,
     265        ) );
     266        $n3 = $this->factory->notification->create( array(
     267            'component_name' => 'messages',
     268            'user_id' => $u,
     269            'is_new' => true,
     270        ) );
     271
     272        $n = BP_Notifications_Notification::get( array(
     273            'user_id' => $u,
     274            'search_terms' => 'roup',
     275        ) );
     276
     277        // Check that the correct items are pulled up
     278        $expected = array( $n2 );
     279        $actual = wp_list_pluck( $n, 'id' );
     280        $this->assertEquals( $expected, $actual );
     281    }
    249282}
Note: See TracChangeset for help on using the changeset viewer.