Changeset 42343 for trunk/tests/phpunit/tests/post/wpInsertPost.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/wpInsertPost.php
r37165 r42343 10 10 */ 11 11 function test_trashing_a_post_should_add_trashed_suffix_to_post_name() { 12 $trashed_about_page_id = self::factory()->post->create( array( 13 'post_type' => 'page', 14 'post_title' => 'About', 15 'post_status' => 'publish' 16 ) ); 12 $trashed_about_page_id = self::factory()->post->create( 13 array( 14 'post_type' => 'page', 15 'post_title' => 'About', 16 'post_status' => 'publish', 17 ) 18 ); 17 19 wp_trash_post( $trashed_about_page_id ); 18 20 $this->assertEquals( 'about__trashed', get_post( $trashed_about_page_id )->post_name ); … … 23 25 */ 24 26 public function test_trashed_suffix_should_be_added_to_post_with__trashed_in_slug() { 25 $trashed_about_page_id = self::factory()->post->create( array( 26 'post_type' => 'page', 27 'post_title' => 'About', 28 'post_status' => 'publish', 29 'post_name' => 'foo__trashed__foo', 30 ) ); 27 $trashed_about_page_id = self::factory()->post->create( 28 array( 29 'post_type' => 'page', 30 'post_title' => 'About', 31 'post_status' => 'publish', 32 'post_name' => 'foo__trashed__foo', 33 ) 34 ); 31 35 wp_trash_post( $trashed_about_page_id ); 32 36 $this->assertEquals( 'foo__trashed__foo__trashed', get_post( $trashed_about_page_id )->post_name ); … … 37 41 */ 38 42 function test_trashed_posts_original_post_name_should_be_reassigned_after_untrashing() { 39 $about_page_id = self::factory()->post->create( array( 40 'post_type' => 'page', 41 'post_title' => 'About', 42 'post_status' => 'publish' 43 ) ); 43 $about_page_id = self::factory()->post->create( 44 array( 45 'post_type' => 'page', 46 'post_title' => 'About', 47 'post_status' => 'publish', 48 ) 49 ); 44 50 wp_trash_post( $about_page_id ); 45 51 … … 52 58 */ 53 59 function test_creating_a_new_post_should_add_trashed_suffix_to_post_name_of_trashed_posts_with_the_desired_slug() { 54 $trashed_about_page_id = self::factory()->post->create( array( 55 'post_type' => 'page', 56 'post_title' => 'About', 57 'post_status' => 'trash' 58 ) ); 60 $trashed_about_page_id = self::factory()->post->create( 61 array( 62 'post_type' => 'page', 63 'post_title' => 'About', 64 'post_status' => 'trash', 65 ) 66 ); 59 67 60 $about_page_id = self::factory()->post->create( array( 61 'post_type' => 'page', 62 'post_title' => 'About', 63 'post_status' => 'publish' 64 ) ); 68 $about_page_id = self::factory()->post->create( 69 array( 70 'post_type' => 'page', 71 'post_title' => 'About', 72 'post_status' => 'publish', 73 ) 74 ); 65 75 66 76 $this->assertEquals( 'about__trashed', get_post( $trashed_about_page_id )->post_name ); … … 69 79 70 80 /** 71 * @ticket 1186372 */81 * @ticket 11863 82 */ 73 83 function test_untrashing_a_post_with_a_stored_desired_post_name_should_get_its_post_name_suffixed_if_another_post_has_taken_the_desired_post_name() { 74 $about_page_id = self::factory()->post->create( array( 75 'post_type' => 'page', 76 'post_title' => 'About', 77 'post_status' => 'publish' 78 ) ); 84 $about_page_id = self::factory()->post->create( 85 array( 86 'post_type' => 'page', 87 'post_title' => 'About', 88 'post_status' => 'publish', 89 ) 90 ); 79 91 wp_trash_post( $about_page_id ); 80 92 81 $another_about_page_id = self::factory()->post->create( array( 82 'post_type' => 'page', 83 'post_title' => 'About', 84 'post_status' => 'publish' 85 ) ); 93 $another_about_page_id = self::factory()->post->create( 94 array( 95 'post_type' => 'page', 96 'post_title' => 'About', 97 'post_status' => 'publish', 98 ) 99 ); 86 100 87 101 wp_untrash_post( $about_page_id );
Note: See TracChangeset
for help on using the changeset viewer.