Changeset 38378 for trunk/tests/phpunit/tests/user/mapMetaCap.php
- Timestamp:
- 08/26/2016 06:22:28 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/mapMetaCap.php
r35242 r38378 256 256 257 257 } 258 259 /** 260 * Test deleting front page. 261 * 262 * @ticket 37580 263 */ 264 function test_only_users_who_can_manage_options_can_delete_page_on_front() { 265 $post_id = self::factory()->post->create( array( 266 'post_type' => 'page', 267 'post_status' => 'publish', 268 ) ); 269 270 update_option( 'page_on_front', $post_id ); 271 $caps = map_meta_cap( 'delete_page', $this->user_id, $post_id ); 272 delete_option( 'page_on_front' ); 273 274 $this->assertEquals( array( 'manage_options' ), $caps ); 275 } 276 277 /** 278 * Test deleting posts page. 279 * 280 * @ticket 37580 281 */ 282 function test_only_users_who_can_manage_options_can_delete_page_for_posts() { 283 $post_id = self::factory()->post->create( array( 284 'post_type' => 'page', 285 'post_status' => 'publish', 286 ) ); 287 288 update_option( 'page_for_posts', $post_id ); 289 $caps = map_meta_cap( 'delete_page', $this->user_id, $post_id ); 290 delete_option( 'page_for_posts' ); 291 292 $this->assertEquals( array( 'manage_options' ), $caps ); 293 } 258 294 }
Note: See TracChangeset
for help on using the changeset viewer.