mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@31515 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -333,7 +333,7 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
$parts = parse_url($url);
|
||||
if (isset($parts['scheme'])) {
|
||||
$req = $parts['path'];
|
||||
$req = isset( $parts['path'] ) ? $parts['path'] : '';
|
||||
if (isset($parts['query'])) {
|
||||
$req .= '?' . $parts['query'];
|
||||
// parse the url query vars into $_GET
|
||||
|
||||
Reference in New Issue
Block a user