Make WordPress Core


Ignore:
Timestamp:
02/23/2015 01:07:18 AM (9 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/includes/testcase.php

    r31469 r31515  
    334334        $parts = parse_url($url);
    335335        if (isset($parts['scheme'])) {
    336             $req = $parts['path'];
     336            $req = isset( $parts['path'] ) ? $parts['path'] : '';
    337337            if (isset($parts['query'])) {
    338338                $req .= '?' . $parts['query'];
Note: See TracChangeset for help on using the changeset viewer.