| 258 | |
| 259 | /** |
| 260 | * Test Front page. |
| 261 | * |
| 262 | * @ticket 37580 |
| 263 | */ |
| 264 | function test_delete_page_on_front() { |
| 265 | $post_id = self::factory()->post->create( array( 'post_type' => 'page', 'post_status' => 'publish' ) ); |
| 266 | |
| 267 | update_option( 'page_on_front', $post_id ); |
| 268 | $this->assertEquals( array( 'manage_options' ), map_meta_cap( 'delete_page', $this->user_id, $post_id ) ); |
| 269 | } |
| 270 | |
| 271 | /** |
| 272 | * Test Posts page. |
| 273 | * |
| 274 | * @ticket 37580 |
| 275 | */ |
| 276 | function test_delete_page_for_posts() { |
| 277 | $post_id = self::factory()->post->create( array( 'post_type' => 'page', 'post_status' => 'publish' ) ); |
| 278 | |
| 279 | update_option( 'page_for_posts', $post_id ); |
| 280 | $this->assertEquals( array( 'manage_options' ), map_meta_cap( 'delete_page', $this->user_id, $post_id ) ); |
| 281 | } |