Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/04/2014 07:47:59 PM (11 years ago)
Author:
boonebgorges
Message:

Don't do a strict type check when deciding on bp_activity_add_user_favorite() return value

Since r8132, bp_activity_update_meta() has returned an integer value when
falling through to add_metadata(). Thus, we should have a more generous test
for whether the update has been successful. See #5399

Fixes #5515

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/activity/functions.php

    r8177 r8237  
    704704        $a = $this->factory->activity->create();
    705705
    706         bp_activity_add_user_favorite( $a, $u );
     706        $this->assertTrue( bp_activity_add_user_favorite( $a, $u ) );
    707707
    708708        $this->assertFalse( bp_activity_add_user_favorite( $a, $u ) );
    709709        $this->assertSame( array( $a ), bp_activity_get_user_favorites( $u ) );
    710710        $this->assertEquals( 1, bp_activity_get_meta( $a, 'favorite_count' ) );
     711    }
     712
     713    /**
     714     * @group favorites
     715     * @group bp_activity_add_user_favorite
     716     */
     717    public function test_add_user_favorite_not_yet_favorited() {
     718        $u = $this->create_user();
     719        $a = $this->factory->activity->create();
     720        $this->assertTrue( bp_activity_add_user_favorite( $a, $u ) );
    711721    }
    712722
Note: See TracChangeset for help on using the changeset viewer.