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 */