| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | class Test_34338 extends WP_UnitTestCase |
|---|
| 4 | { |
|---|
| 5 | function test_remove_object_terms() |
|---|
| 6 | { |
|---|
| 7 | $post_id = $this->factory->post->create(); |
|---|
| 8 | wp_set_object_terms($post_id, 'test', 'category'); |
|---|
| 9 | |
|---|
| 10 | // Pollute the cache |
|---|
| 11 | $terms = get_the_terms($post_id, 'category'); |
|---|
| 12 | |
|---|
| 13 | wp_remove_object_terms($post_id, 'test', 'category'); |
|---|
| 14 | $this->assertEquals(false, get_the_terms($post_id, 'category')); // should work but not work |
|---|
| 15 | |
|---|
| 16 | wp_set_object_terms($post_id, null, 'category'); |
|---|
| 17 | $this->assertEquals(false, get_the_terms($post_id, 'category')); // work |
|---|
| 18 | } |
|---|
| 19 | } |
|---|