Changeset 30522 for trunk/tests/phpunit/tests/post.php
- Timestamp:
- 11/22/2014 08:41:04 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post.php
r30510 r30522 987 987 988 988 /** 989 * @ticket 18962990 */991 function test_wp_unique_post_slug_with_hierarchy_and_attachments() {992 register_post_type( 'post-type-1', array( 'hierarchical' => true ) );993 994 $args = array(995 'post_type' => 'post-type-1',996 'post_name' => 'some-slug',997 'post_status' => 'publish',998 );999 $one = $this->factory->post->create( $args );1000 1001 $args = array(1002 'post_mime_type' => 'image/jpeg',1003 'post_type' => 'attachment',1004 'post_name' => 'image'1005 );1006 $attachment = $this->factory->attachment->create_object( 'image.jpg', $one, $args );1007 1008 $args = array(1009 'post_type' => 'post-type-1',1010 'post_name' => 'image',1011 'post_status' => 'publish',1012 'post_parent' => $one1013 );1014 $two = $this->factory->post->create( $args );1015 1016 $this->assertEquals( 'some-slug', get_post( $one )->post_name );1017 $this->assertEquals( 'image', get_post( $attachment )->post_name );1018 $this->assertEquals( 'image-2', get_post( $two )->post_name );1019 1020 // 'image' can be a child of image-21021 $this->assertEquals( 'image', wp_unique_post_slug( 'image', 0, 'publish', 'post-type-1', $two ) );1022 1023 _unregister_post_type( 'post-type-1' );1024 }1025 1026 /**1027 989 * @ticket 21212 1028 990 */
Note: See TracChangeset
for help on using the changeset viewer.