Skip to:
Content

BuddyPress.org

Ticket #6242: 6242.unittest.patch

File 6242.unittest.patch, 1010 bytes (added by imath, 10 years ago)
  • tests/phpunit/testcases/members/types.php

    diff --git tests/phpunit/testcases/members/types.php tests/phpunit/testcases/members/types.php
    index de047a0..ed276a8 100644
    class BP_Tests_Members_Types extends BP_UnitTestCase { 
    205205                $this->assertFalse( wp_cache_get( $u, 'bp_member_type' ) );
    206206                $this->assertFalse( bp_get_member_type( $u ) );
    207207        }
     208
     209        /**
     210         * @group BP6242
     211         * @group cache
     212         */
     213        public function test_bp_get_member_type_should_not_conflict_with_term_cache() {
     214                $u1 = $this->factory->user->create();
     215                $u2 = $this->factory->user->create();
     216                bp_register_member_type( 'foo' );
     217                bp_set_member_type( $u2, 'foo' );
     218
     219                // Make sure WordPress is using update_term_cache()
     220                $terms = get_terms( 'bp_member_type', array( 'hide_empty' => false, 'fields' => 'all' ) );
     221
     222                $this->assertFalse( wp_cache_get( $u1, 'bp_member_type' ), 'The BuddyPress member type cache should not conflict with the WordPress term cache' );
     223        }
    208224}