Make WordPress Core


Ignore:
Timestamp:
02/23/2015 01:07:18 AM (10 years ago)
Author:
boonebgorges
Message:

Ensure that a request URL is always set in WP_UnitTestCase::go_to().

Failure to set this variable meant that passing the home URL to go_to()
(without a trailing slash) resulted in a PHP notice, and failed to reset the
globals properly.

Props joostdevalk.
Fixes #31417.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/includes/helpers.php

    r31306 r31515  
    186186    }
    187187
     188    /**
     189     * @ticket 31417
     190     */
     191    public function test_go_to_should_go_to_home_page_when_passing_the_untrailingslashed_home_url() {
     192        $this->assertFalse( is_home() );
     193        $home = untrailingslashit( get_option( 'home' ) );
     194        $this->go_to( $home );
     195        $this->assertTrue( is_home() );
     196    }
     197
    188198    protected function mock_deprecated() {
    189199        _deprecated_function( __METHOD__, '2.5' );
Note: See TracChangeset for help on using the changeset viewer.