[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/tests/phpunit/testcases/members/template/ -> bpGetMemberClass.php (source)

   1  <?php
   2  
   3  /**
   4   * @group members
   5   */
   6  class BP_Tests_Members_Template_BpGetMemberClass extends BP_UnitTestCase {
   7      /**
   8       * @ticket BP6996
   9       */
  10  	public function test_should_contain_member_type_classes() {
  11          buddypress()->members->types = array();
  12          bp_register_member_type( 'foo' );
  13          bp_register_member_type( 'bar' );
  14  
  15          $u = self::factory()->user->create();
  16          bp_set_member_type( $u, 'bar' );
  17  
  18          if ( bp_has_members( array( 'include' => array( $u ) ) ) ) {
  19              while ( bp_members() ) {
  20                  bp_the_member();
  21                  $found = bp_get_member_class();
  22              }
  23          }
  24  
  25          global $members_template;
  26          unset( $members_template );
  27          buddypress()->members->types = array();
  28  
  29          $this->assertContains( 'member-type-bar', $found );
  30          $this->assertNotContains( 'member-type-foo', $found );
  31      }
  32  }


Generated: Sat Nov 28 01:01:39 2020 Cross-referenced by PHPXref 0.7.1