WordPress.org

Make WordPress Core

Changeset 643 in tests


Ignore:
Timestamp:
04/08/2012 03:47:55 AM (6 years ago)
Author:
nacin
Message:

Clean up taxonomy object type assignments so other tests in the suite do not fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_post.php

    r641 r643  
    7878            $this->assertFalse( wp_cache_get( $id, "ctax_relationships" ) );
    7979        }
     80
     81        $GLOBALS['wp_taxonomies']['post_tag']->object_type = array( 'post' );
    8082    }
    8183
     
    896898
    897899    function test_register_taxonomy_for_object_type() {
     900        global $wp_taxonomies;
     901
    898902        register_post_type( 'bar' );
    899903        register_taxonomy_for_object_type( 'post_tag', 'bar' );
     
    901905        register_taxonomy_for_object_type( 'category', 'bar' );
    902906        $this->assertEquals( array( 'category', 'post_tag' ), get_object_taxonomies( 'bar' ) );
     907
     908        $this->assertTrue( is_object_in_taxonomy( 'bar', 'post_tag' ) );
     909        $this->assertTrue( is_object_in_taxonomy( 'bar', 'post_tag' ) );
     910
     911        // Clean up. Remove the 'bar' post type from these taxonomies.
     912        $GLOBALS['wp_taxonomies']['post_tag']->object_type = array( 'post' );
     913        $GLOBALS['wp_taxonomies']['category']->object_type = array( 'post' );
     914
     915        $this->assertFalse( is_object_in_taxonomy( 'bar', 'post_tag' ) );
     916        $this->assertFalse( is_object_in_taxonomy( 'bar', 'post_tag' ) );
    903917    }
    904918
Note: See TracChangeset for help on using the changeset viewer.