WordPress.org

Make WordPress Core

Changeset 35256


Ignore:
Timestamp:
10/18/2015 01:34:29 AM (4 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

Location:
trunk/tests/phpunit/tests
Files:
2 edited

Legend:

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

    r35242 r35256  
    291291
    292292    /**
    293      * @ticket 25143
    294      */
    295     public function test_is_home_should_be_false_when_visiting_custom_endpoint_without_a_registered_query_var_and_page_on_front_is_set() {
    296 
    297         $page_id = self::factory()->post->create( array( 'post_type' => 'page' ) );
    298         update_option( 'show_on_front', 'page' );
    299         update_option( 'page_on_front', $page_id );
    300 
    301         add_rewrite_endpoint( 'test', EP_ALL, false );
    302         flush_rewrite_rules();
    303 
    304         $this->go_to( home_url( '/test/1' ) );
    305 
    306         $this->assertQueryTrue( 'is_front_page', 'is_page', 'is_singular' );
    307         $this->assertFalse( is_home() );
    308     }
    309 
    310     /**
    311293     * @ticket 21970
    312294     */
  • 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.