Add a test case for calling get_page_uri() with a non-existent post.

see #24491, [25262].


git-svn-id: https://develop.svn.wordpress.org/trunk@25265 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-09-05 22:02:42 +00:00
parent f280a2f525
commit 27b0660c5f

View File

@ -603,6 +603,15 @@ class Tests_Post extends WP_UnitTestCase {
$this->assertEquals( 'get-page-uri-post-name', get_page_uri( $post_array ) );
}
/**
* @ticket 24491
*/
function test_get_page_uri_with_nonexistent_post() {
global $wpdb;
$post_id = $wpdb->get_var( "SELECT MAX(ID) FROM $wpdb->posts" ) + 1;
$this->assertFalse( get_page_uri( $post_id ) );
}
/**
* @ticket 23708
*/