[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/tests/phpunit/testcases/groups/ -> avatars.php (source)

   1  <?php
   2  
   3  /**
   4   * @group avatars
   5   * @group groups
   6   */
   7  class BP_Tests_Groups_Avatars extends BP_UnitTestCase {
   8      /**
   9       * @group bp_get_group_has_avatar
  10       */
  11      public function test_bp_get_group_has_avatar_no_avatar_uploaded() {
  12          $g = self::factory()->group->create();
  13          $this->assertFalse( bp_get_group_has_avatar( $g ) );
  14      }
  15  
  16      /**
  17       * @group bp_get_group_has_avatar
  18       */
  19      public function test_bp_get_group_has_avatar_has_avatar_uploaded() {
  20          $g = self::factory()->group->create();
  21  
  22          // Fake it
  23          add_filter( 'bp_core_fetch_avatar_url', array( $this, 'avatar_cb' ) );
  24  
  25          $this->assertTrue( bp_get_group_has_avatar( $g ) );
  26  
  27          remove_filter( 'bp_core_fetch_avatar_url', array( $this, 'avatar_cb' ) );
  28      }
  29  
  30  	public function avatar_cb() {
  31          return 'foo';
  32      }
  33  }


Generated: Sat Jul 20 01:01:39 2019 Cross-referenced by PHPXref 0.7.1