From 6845b3cd4ae7c48a44837ac06a493cb477219e47 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 18 Oct 2015 01:34:29 +0000 Subject: [PATCH] Move the `test_is_home_should_be_false_when_visiting_custom_endpoint_without_a_registered_query_var_and_page_on_front_is_set()` test into a more appropriate place. See #25143 git-svn-id: https://develop.svn.wordpress.org/trunk@35256 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rewrite.php | 18 ------------------ .../tests/rewrite/addRewriteEndpoint.php | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/phpunit/tests/rewrite.php b/tests/phpunit/tests/rewrite.php index 338cb9b73e..1f7426e3d3 100644 --- a/tests/phpunit/tests/rewrite.php +++ b/tests/phpunit/tests/rewrite.php @@ -289,24 +289,6 @@ class Tests_Rewrite extends WP_UnitTestCase { restore_current_blog(); } - /** - * @ticket 25143 - */ - public function test_is_home_should_be_false_when_visiting_custom_endpoint_without_a_registered_query_var_and_page_on_front_is_set() { - - $page_id = self::factory()->post->create( array( 'post_type' => 'page' ) ); - update_option( 'show_on_front', 'page' ); - update_option( 'page_on_front', $page_id ); - - add_rewrite_endpoint( 'test', EP_ALL, false ); - flush_rewrite_rules(); - - $this->go_to( home_url( '/test/1' ) ); - - $this->assertQueryTrue( 'is_front_page', 'is_page', 'is_singular' ); - $this->assertFalse( is_home() ); - } - /** * @ticket 21970 */ diff --git a/tests/phpunit/tests/rewrite/addRewriteEndpoint.php b/tests/phpunit/tests/rewrite/addRewriteEndpoint.php index ab721ce7a2..cde5e61535 100644 --- a/tests/phpunit/tests/rewrite/addRewriteEndpoint.php +++ b/tests/phpunit/tests/rewrite/addRewriteEndpoint.php @@ -47,4 +47,22 @@ class Tests_Rewrite_AddRewriteEndpoint extends WP_UnitTestCase { add_rewrite_endpoint( 'foo', EP_ALL, false ); $this->assertSame( $qvs, $GLOBALS['wp']->public_query_vars ); } + + /** + * @ticket 25143 + */ + public function test_is_home_should_be_false_when_visiting_custom_endpoint_without_a_registered_query_var_and_page_on_front_is_set() { + + $page_id = self::factory()->post->create( array( 'post_type' => 'page' ) ); + update_option( 'show_on_front', 'page' ); + update_option( 'page_on_front', $page_id ); + + add_rewrite_endpoint( 'test', EP_ALL, false ); + flush_rewrite_rules(); + + $this->go_to( home_url( '/test/1' ) ); + + $this->assertQueryTrue( 'is_front_page', 'is_page', 'is_singular' ); + $this->assertFalse( is_home() ); + } }