Make WordPress Core


Ignore:
Timestamp:
10/18/2015 01:34:29 AM (9 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rewrite/addRewriteEndpoint.php

    r32293 r35256  
    4848        $this->assertSame( $qvs, $GLOBALS['wp']->public_query_vars );
    4949    }
     50
     51    /**
     52     * @ticket 25143
     53     */
     54    public function test_is_home_should_be_false_when_visiting_custom_endpoint_without_a_registered_query_var_and_page_on_front_is_set() {
     55
     56        $page_id = self::factory()->post->create( array( 'post_type' => 'page' ) );
     57        update_option( 'show_on_front', 'page' );
     58        update_option( 'page_on_front', $page_id );
     59
     60        add_rewrite_endpoint( 'test', EP_ALL, false );
     61        flush_rewrite_rules();
     62
     63        $this->go_to( home_url( '/test/1' ) );
     64
     65        $this->assertQueryTrue( 'is_front_page', 'is_page', 'is_singular' );
     66        $this->assertFalse( is_home() );
     67    }
    5068}
Note: See TracChangeset for help on using the changeset viewer.