Make WordPress Core


Ignore:
Timestamp:
02/20/2020 05:04:42 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Fix the Travis CI build for the 3.9 branch.

Among other fixes, this backports [28943], [28961], [28964-28968], [28988], [29120], [29251], [29503], [29860], [29869], [29954], [30001], [30160], [30282], [30285], [30289-30291], [30513-30514], [30516-30521], [30523-30524], [30526], [30529-30530], [31253-31254], [31257-31259], [31622], [33374], [40255], [40257], [40259], [40269], [40271], [40446], [40449], [40457], [40604], [40538], [40833], [41082], [41303], [41306], [44993].

See #49485.

Location:
branches/3.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.9

  • branches/3.9/tests/phpunit/tests/term.php

    r27104 r47329  
    413413
    414414        /**
    415          * @ticket 5809
    416          */
    417         function test_update_shared_term() {
    418                 $random_tax = __FUNCTION__;
    419 
    420                 register_taxonomy( $random_tax, 'post' );
    421 
    422                 $post_id = $this->factory->post->create();
    423 
    424                 $old_name = 'Initial';
    425 
    426                 $t1 = wp_insert_term( $old_name, 'category' );
    427                 $t2 = wp_insert_term( $old_name, 'post_tag' );
    428 
    429                 $this->assertEquals( $t1['term_id'], $t2['term_id'] );
    430 
    431                 wp_set_post_categories( $post_id, array( $t1['term_id'] ) );
    432                 wp_set_post_tags( $post_id, array( (int) $t2['term_id'] ) );
    433 
    434                 $new_name = 'Updated';
    435 
    436                 // create the term in a third taxonomy, just to keep things interesting
    437                 $t3 = wp_insert_term( $old_name, $random_tax );
    438                 wp_set_post_terms( $post_id, array( (int) $t3['term_id'] ), $random_tax );
    439                 $this->assertPostHasTerms( $post_id, array( $t3['term_id'] ), $random_tax );
    440 
    441                 $t2_updated = wp_update_term( $t2['term_id'], 'post_tag', array(
    442                         'name' => $new_name
    443                 ) );
    444 
    445                 $this->assertNotEquals( $t2_updated['term_id'], $t3['term_id'] );
    446 
    447                 // make sure the terms have split
    448                 $this->assertEquals( $old_name, get_term_field( 'name', $t1['term_id'], 'category' ) );
    449                 $this->assertEquals( $new_name, get_term_field( 'name', $t2_updated['term_id'], 'post_tag' ) );
    450 
    451                 // and that they are still assigned to the correct post
    452                 $this->assertPostHasTerms( $post_id, array( $t1['term_id'] ), 'category' );
    453                 $this->assertPostHasTerms( $post_id, array( $t2_updated['term_id'] ), 'post_tag' );
    454                 $this->assertPostHasTerms( $post_id, array( $t3['term_id'] ), $random_tax );
    455 
    456                 // clean up
    457                 unset( $GLOBALS['wp_taxonomies'][ $random_tax ] );
    458         }
    459 
    460         /**
    461415         * @ticket 17646
    462416         */
Note: See TracChangeset for help on using the changeset viewer.