Make WordPress Core


Ignore:
Timestamp:
04/15/2017 07:38:18 PM (9 years ago)
Author:
johnbillion
Message:

Taxonomy: Remove a failing test from the 4.0 branch.

This functionality was fixed in [30241] but the test was failing prior to that.

See #5809

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0/tests/phpunit/tests/term.php

    r29196 r40446  
    572572
    573573        /**
    574          * @ticket 5809
    575          */
    576         function test_update_shared_term() {
    577                 $random_tax = __FUNCTION__;
    578 
    579                 register_taxonomy( $random_tax, 'post' );
    580 
    581                 $post_id = $this->factory->post->create();
    582 
    583                 $old_name = 'Initial';
    584 
    585                 $t1 = wp_insert_term( $old_name, 'category' );
    586                 $t2 = wp_insert_term( $old_name, 'post_tag' );
    587 
    588                 $this->assertEquals( $t1['term_id'], $t2['term_id'] );
    589 
    590                 wp_set_post_categories( $post_id, array( $t1['term_id'] ) );
    591                 wp_set_post_tags( $post_id, array( (int) $t2['term_id'] ) );
    592 
    593                 $new_name = 'Updated';
    594 
    595                 // create the term in a third taxonomy, just to keep things interesting
    596                 $t3 = wp_insert_term( $old_name, $random_tax );
    597                 wp_set_post_terms( $post_id, array( (int) $t3['term_id'] ), $random_tax );
    598                 $this->assertPostHasTerms( $post_id, array( $t3['term_id'] ), $random_tax );
    599 
    600                 $t2_updated = wp_update_term( $t2['term_id'], 'post_tag', array(
    601                         'name' => $new_name
    602                 ) );
    603 
    604                 $this->assertNotEquals( $t2_updated['term_id'], $t3['term_id'] );
    605 
    606                 // make sure the terms have split
    607                 $this->assertEquals( $old_name, get_term_field( 'name', $t1['term_id'], 'category' ) );
    608                 $this->assertEquals( $new_name, get_term_field( 'name', $t2_updated['term_id'], 'post_tag' ) );
    609 
    610                 // and that they are still assigned to the correct post
    611                 $this->assertPostHasTerms( $post_id, array( $t1['term_id'] ), 'category' );
    612                 $this->assertPostHasTerms( $post_id, array( $t2_updated['term_id'] ), 'post_tag' );
    613                 $this->assertPostHasTerms( $post_id, array( $t3['term_id'] ), $random_tax );
    614 
    615                 // clean up
    616                 unset( $GLOBALS['wp_taxonomies'][ $random_tax ] );
    617         }
    618 
    619         /**
    620574         * @ticket 25852
    621575         */
Note: See TracChangeset for help on using the changeset viewer.