Changeset 54068
- Timestamp:
- 09/05/2022 02:31:05 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post.php
r54067 r54068 315 315 316 316 /** 317 * If a post is sticky and is updated by a user that does not have the publish_post capability,318 * it should _stay_sticky.317 * If a sticky post is updated via `wp_update_post()` by a user 318 * without the `publish_posts` capability, it should stay sticky. 319 319 * 320 320 * @ticket 24153 321 321 */ 322 public function test_user_without_publish_cannot_affect_sticky() { 322 public function test_user_without_publish_posts_cannot_affect_sticky() { 323 // Create a sticky post. 324 $post = self::factory()->post->create_and_get( 325 array( 326 'post_title' => 'Will be changed', 327 'post_content' => 'Will be changed', 328 ) 329 ); 330 stick_post( $post->ID ); 331 332 // Sanity check. 333 $this->assertTrue( is_sticky( $post->ID ) ); 334 323 335 wp_set_current_user( self::$grammarian_id ); 324 336 … … 327 339 $this->assertTrue( current_user_can( 'edit_others_posts' ) ); 328 340 $this->assertTrue( current_user_can( 'edit_published_posts' ) ); 329 330 // Create a sticky post.331 $post = self::factory()->post->create_and_get(332 array(333 'post_title' => 'Will be changed',334 'post_content' => 'Will be changed',335 )336 );337 stick_post( $post->ID );338 339 // Sanity check.340 $this->assertTrue( is_sticky( $post->ID ) );341 341 342 342 // Edit the post. … … 353 353 354 354 /** 355 * If the `edit_post()` method is invoked by a user without publish_posts permission,356 * the sticky status of the post should not be changed.355 * If a sticky post is updated via `edit_post()` by a user 356 * without the `publish_posts` capability, it should stay sticky. 357 357 * 358 358 * @ticket 24153 359 359 */ 360 public function test_user_without_publish_ cannot_affect_sticky_with_edit_post() {360 public function test_user_without_publish_posts_cannot_affect_sticky_with_edit_post() { 361 361 // Create a sticky post. 362 362 $post = self::factory()->post->create_and_get(
Note: See TracChangeset
for help on using the changeset viewer.