Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/06/2014 04:20:31 PM (10 years ago)
Author:
boonebgorges
Message:

Ensure bp_get_user_has_avatar() returns false when the default avatar is returned

Necessitated by changes in return values introduced in r7769

See #5380

Props imath

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/core/avatars.php

    r8108 r8243  
    5454        $this->go_to( '/' );
    5555    }
     56
     57    /**
     58     * @group bp_get_user_has_avatar
     59     */
     60    public function test_bp_get_user_has_avatar_no_avatar_uploaded() {
     61        $u = $this->create_user();
     62        $this->assertFalse( bp_get_user_has_avatar( $u ) );
     63    }
     64
     65    /**
     66     * @group bp_get_user_has_avatar
     67     */
     68    public function test_bp_get_user_has_avatar_has_avatar_uploaded() {
     69        $u = $this->create_user();
     70
     71        // Fake it
     72        add_filter( 'bp_core_fetch_avatar_url', array( $this, 'avatar_cb' ) );
     73
     74        $this->assertTrue( bp_get_user_has_avatar( $u ) );
     75
     76        remove_filter( 'bp_core_fetch_avatar_url', array( $this, 'avatar_cb' ) );
     77    }
     78
     79    public function avatar_cb() {
     80        return 'foo';
     81    }
    5682}
Note: See TracChangeset for help on using the changeset viewer.