Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions tests/phpunit/tests/link.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ public function test_unattached_attachment_has_a_pretty_permalink() {
* @ticket 1914
*/
public function test_attachment_attached_to_non_existent_post_type_has_a_pretty_permalink() {
global $wp_post_types;

$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );

register_post_type( 'not_a_post_type', array( 'public' => true ) );
Expand All @@ -175,12 +173,7 @@ public function test_attachment_attached_to_non_existent_post_type_has_a_pretty_

$this->assertSame( get_permalink( $post_id ) . user_trailingslashit( $attachment->post_name ), get_permalink( $attachment_id ) );

foreach ( $wp_post_types as $id => $pt ) {
if ( 'not_a_post_type' === $pt->name ) {
unset( $wp_post_types[ $id ] );
break;
}
}
unregister_post_type( 'not_a_post_type' );

$this->assertSame( home_url( "/?attachment_id={$attachment->ID}" ), get_permalink( $attachment_id ) );
// Visit permalink.
Expand Down
Loading