Changeset 9533 for trunk/tests/phpunit/testcases/members/types.php
- Timestamp:
- 02/23/2015 01:39:05 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/testcases/members/types.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/members/types.php
r9486 r9533 206 206 $this->assertFalse( bp_get_member_type( $u ) ); 207 207 } 208 209 /** 210 * @group BP6242 211 * @group cache 212 */ 213 public function test_bp_get_member_type_should_not_conflict_with_term_cache() { 214 global $wpdb; 215 216 // Offset IDs. 217 $dummy_terms = $this->factory->tag->create_many( 5 ); 218 219 $u1 = $this->factory->user->create(); 220 bp_register_member_type( 'foo' ); 221 bp_set_member_type( $u1, 'foo' ); 222 223 // Fetch a term ID. 224 $terms = get_terms( 'bp_member_type', array( 'hide_empty' => false, 'fields' => 'all' ) ); 225 226 // Make sure the user's ID matches a term ID, to force a cache confusion. 227 $u2 = $this->factory->user->create(); 228 $new_user_id = $terms[0]->term_id; 229 $wpdb->update( $wpdb->users, array( 'ID' => $new_user_id ), array( 'ID' => $u2 ) ); 230 231 bp_set_member_type( $new_user_id, 'foo' ); 232 233 // Reprime the taxonomy cache. 234 $terms = get_terms( 'bp_member_type', array( 'hide_empty' => false, 'fields' => 'all' ) ); 235 236 $this->assertSame( 'foo', bp_get_member_type( $new_user_id, true ) ); 237 } 208 238 }
Note: See TracChangeset
for help on using the changeset viewer.