WordPress.org

Make WordPress Core

Changeset 481 in tests


Ignore:
Timestamp:
11/28/11 22:35:34 (2 years ago)
Author:
nacin
Message:

convert_to_screen() collision tests. see #WP19353.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_admin_includes_screen.php

    r480 r481  
    133133        $this->assertEquals( $screen->id, 'edit-edit-some-thing' ); 
    134134    } 
     135 
     136    function test_post_type_edit_collisions() { 
     137        register_post_type( 'comments' ); 
     138        register_post_type( 'tags' ); 
     139 
     140        // Sorry, core wins here. 
     141        $screen = convert_to_screen( 'edit-comments' ); 
     142        $this->assertEquals( $screen->base, 'edit-comments' ); 
     143 
     144        // The post type wins here. convert_to_screen( $post_type ) is only relevant for meta boxes anyway. 
     145        $screen = convert_to_screen( 'comments' ); 
     146        $this->assertEquals( $screen->base, 'post' ); 
     147     
     148        // Core wins. 
     149        $screen = convert_to_screen( 'edit-tags' ); 
     150        $this->assertEquals( $screen->base, 'edit-tags' ); 
     151 
     152        $screen = convert_to_screen( 'tags' ); 
     153        $this->assertEquals( $screen->base, 'post' ); 
     154    } 
    135155} 
Note: See TracChangeset for help on using the changeset viewer.