990eebf373
Props tszming. Fixes #34338. git-svn-id: https://develop.svn.wordpress.org/trunk@35268 602fd350-edb4-49c9-b593-d223f7449a82
25 lines
593 B
PHP
25 lines
593 B
PHP
<?php
|
|
|
|
/**
|
|
* @group taxonomy
|
|
*/
|
|
class Tests_Term_WpRemoveObjectTerms extends WP_UnitTestCase {
|
|
/**
|
|
* @ticket 34338
|
|
*/
|
|
public function test_removal_should_delete_object_relationship_cache() {
|
|
register_taxonomy( 'wptests_tax', 'post' );
|
|
$p = self::factory()->post->create();
|
|
$t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) );
|
|
|
|
wp_set_object_terms( $p, $t, 'wptests_tax' );
|
|
|
|
// Pollute the cache.
|
|
get_the_terms( $p, 'wptests_tax' );
|
|
|
|
wp_remove_object_terms( $p, $t, 'wptests_tax' );
|
|
|
|
$this->assertFalse( get_the_terms( $p, 'wptests_tax' ) );
|
|
}
|
|
}
|