WordPress.org

Make WordPress Core

Changeset 1091 in tests


Ignore:
Timestamp:
10/24/12 22:16:35 (18 months ago)
Author:
ryan
Message:

More create_posts capability tests. see #WP16714

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/user/capabilities.php

    r1054 r1091  
    534534 
    535535        _unregister_post_type( 'foobar' ); 
     536 
     537        register_post_type( 'something', array( 'capabilities' => array( 'edit_posts' => 'draw_somethings' ) ) ); 
     538        $something = get_post_type_object( 'something' ); 
     539        $this->assertEquals( 'draw_somethings', $something->cap->edit_posts ); 
     540        $this->assertEquals( 'draw_somethings', $something->cap->create_posts ); 
     541 
     542        register_post_type( 'something', array( 'capabilities' => 
     543                        array( 'edit_posts' => 'draw_somethings', 'create_posts' => 'create_somethings' ) ) ); 
     544        $something = get_post_type_object( 'something' ); 
     545        $this->assertEquals( 'draw_somethings', $something->cap->edit_posts ); 
     546        $this->assertEquals( 'create_somethings', $something->cap->create_posts ); 
     547        _unregister_post_type( 'something' ); 
    536548 
    537549        // Test meta authorization callbacks 
Note: See TracChangeset for help on using the changeset viewer.