Tests: Remove duplicate `test_get_page_by_path_priority()` test.

The test was moved into its own file in [37478], but never removed from its previous location.

See #36711.

git-svn-id: https://develop.svn.wordpress.org/trunk@46819 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-12-06 17:25:32 +00:00
parent 47e38ea2e9
commit 0c673c2308
1 changed files with 0 additions and 40 deletions

View File

@ -559,46 +559,6 @@ class Tests_Post extends WP_UnitTestCase {
$this->assertEquals( get_option( 'siteurl' ) . '/2007/10/31/' . $id . '/', $plink );
}
/**
* @ticket 15665
*/
function test_get_page_by_path_priority() {
global $wpdb;
$attachment = self::factory()->post->create_and_get(
array(
'post_title' => 'some-page',
'post_type' => 'attachment',
)
);
$page = self::factory()->post->create_and_get(
array(
'post_title' => 'some-page',
'post_type' => 'page',
)
);
$other_att = self::factory()->post->create_and_get(
array(
'post_title' => 'some-other-page',
'post_type' => 'attachment',
)
);
$wpdb->update( $wpdb->posts, array( 'post_name' => 'some-page' ), array( 'ID' => $page->ID ) );
clean_post_cache( $page->ID );
$page = get_post( $page->ID );
$this->assertEquals( 'some-page', $attachment->post_name );
$this->assertEquals( 'some-page', $page->post_name );
// get_page_by_path() should return a post of the requested type before returning an attachment.
$this->assertEquals( $page, get_page_by_path( 'some-page' ) );
// Make sure get_page_by_path() will still select an attachment when a post of the requested type doesn't exist.
$this->assertEquals( $other_att, get_page_by_path( 'some-other-page' ) );
}
function test_wp_publish_post() {
$draft_id = self::factory()->post->create( array( 'post_status' => 'draft' ) );