1
0
Fork 0
mirror of https://github.com/buddypress/buddypress.git synced 2026-07-21 20:54:17 +08:00
buddypress/tests/phpunit/testcases/groups/avatars.php
Boone B Gorges 0ed016254c Use static factory method throughout PHPUnit tests.
See #7620.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@11737 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2017-11-03 19:44:10 +00:00

33 lines
751 B
PHP

<?php
/**
* @group avatars
* @group groups
*/
class BP_Tests_Groups_Avatars extends BP_UnitTestCase {
/**
* @group bp_get_group_has_avatar
*/
public function test_bp_get_group_has_avatar_no_avatar_uploaded() {
$g = self::factory()->group->create();
$this->assertFalse( bp_get_group_has_avatar( $g ) );
}
/**
* @group bp_get_group_has_avatar
*/
public function test_bp_get_group_has_avatar_has_avatar_uploaded() {
$g = self::factory()->group->create();
// Fake it
add_filter( 'bp_core_fetch_avatar_url', array( $this, 'avatar_cb' ) );
$this->assertTrue( bp_get_group_has_avatar( $g ) );
remove_filter( 'bp_core_fetch_avatar_url', array( $this, 'avatar_cb' ) );
}
public function avatar_cb() {
return 'foo';
}
}