Changeset 425 in tests
- Timestamp:
- 08/23/2011 12:48:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test_includes_capabilities.php
r424 r425 133 133 register_post_type( $this->post_type, array( 134 134 'capability_type' => 'post', 135 'capabilities' => array( 136 'edit_post' => 'edit_book', 137 'read_post' => 'read_book', 138 'delete_post' => 'delete_book', 139 ), 140 ) ); 141 142 $post_type_object = get_post_type_object( $this->post_type ); 143 144 $this->assertFalse( $post_type_object->map_meta_cap ); 145 146 $this->assertEquals( array( 'edit_book' ), 147 map_meta_cap( 'edit_post', $this->user_id, $this->post_id ) ); 148 $this->assertEquals( array( 'edit_book' ), 149 map_meta_cap( $post_type_object->cap->edit_post, $this->user_id, $this->post_id ) ); 150 151 $this->assertEquals( array( 'read_book' ), 152 map_meta_cap( 'read_post', $this->user_id, $this->post_id ) ); 153 $this->assertEquals( array( 'read_book' ), 154 map_meta_cap( $post_type_object->cap->read_post, $this->user_id, $this->post_id ) ); 155 156 $this->assertEquals( array( 'delete_book' ), 157 map_meta_cap( 'delete_post', $this->user_id, $this->post_id ) ); 158 $this->assertEquals( array( 'delete_book' ), 159 map_meta_cap( $post_type_object->cap->delete_post, $this->user_id, $this->post_id ) ); 160 } 161 162 function test_capability_type_post_with_all_meta_caps_renamed_mapped() { 163 register_post_type( $this->post_type, array( 164 'capability_type' => 'post', 135 165 'map_meta_cap' => true, 136 166 'capabilities' => array(
Note: See TracChangeset
for help on using the changeset viewer.