WordPress.org

Make WordPress Core

Changeset 1029 in tests


Ignore:
Timestamp:
09/20/12 22:00:29 (19 months ago)
Author:
scribu
Message:

add test for updating a term shared by two taxonomies. props wonderboymusic for initial patch.

see #125 and #WP5809

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/term.php

    r922 r1029  
    309309            $this->assertTrue( wp_delete_term( $t['term_id'], $this->taxonomy ) ); 
    310310    } 
     311 
     312    /** 
     313     * @ticket 5809 
     314     */ 
     315    function test_update_shared_term() { 
     316        $term_1 = rand_str(); 
     317 
     318        $t1 = wp_insert_term( $term_1, 'category' ); 
     319        $t2 = wp_insert_term( $term_1, 'post_tag' ); 
     320 
     321        $this->assertEquals( $t1['term_id'], $t2['term_id'] ); 
     322 
     323        $term_2 = rand_str(); 
     324        $new_term = wp_update_term( $t2['term_id'], 'post_tag', array( 'name' => $term_2 ) ); 
     325 
     326        $this->assertNotEquals( $t1['term_id'], $new_term['term_id'] ); 
     327    } 
    311328} 
Note: See TracChangeset for help on using the changeset viewer.