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
This commit is contained in:
parent
ab43e7362d
commit
6845b3cd4a
@ -289,24 +289,6 @@ class Tests_Rewrite extends WP_UnitTestCase {
|
|||||||
restore_current_blog();
|
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
|
* @ticket 21970
|
||||||
*/
|
*/
|
||||||
|
@ -47,4 +47,22 @@ class Tests_Rewrite_AddRewriteEndpoint extends WP_UnitTestCase {
|
|||||||
add_rewrite_endpoint( 'foo', EP_ALL, false );
|
add_rewrite_endpoint( 'foo', EP_ALL, false );
|
||||||
$this->assertSame( $qvs, $GLOBALS['wp']->public_query_vars );
|
$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() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user