From 27b0660c5f162fef9d0757d1adcca53f55f3ede9 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 5 Sep 2013 22:02:42 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/post.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/phpunit/tests/post.php b/tests/phpunit/tests/post.php index b604e7b2b0..130035e1a7 100644 --- a/tests/phpunit/tests/post.php +++ b/tests/phpunit/tests/post.php @@ -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 */