Loading core/tests/Drupal/Tests/UiHelperTrait.php +8 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,8 @@ protected function drupalGet($path, array $options = [], array $headers = []) { * An absolute URL string. */ protected function buildUrl($path, array $options = []) { global $base_path; if ($path instanceof Url) { $url_options = $path->getOptions(); $options = $url_options + $options; Loading @@ -281,6 +283,12 @@ protected function buildUrl($path, array $options = []) { // The URL generator service is not necessarily available yet; e.g., in // interactive installer tests. elseif (\Drupal::hasService('url_generator')) { // Strip $base_path, if existent. $length = strlen($base_path); if (substr($path, 0, $length) === $base_path) { $path = substr($path, $length); } $force_internal = isset($options['external']) && $options['external'] == FALSE; if (!$force_internal && UrlHelper::isExternal($path)) { return Url::fromUri($path, $options)->toString(); Loading Loading
core/tests/Drupal/Tests/UiHelperTrait.php +8 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,8 @@ protected function drupalGet($path, array $options = [], array $headers = []) { * An absolute URL string. */ protected function buildUrl($path, array $options = []) { global $base_path; if ($path instanceof Url) { $url_options = $path->getOptions(); $options = $url_options + $options; Loading @@ -281,6 +283,12 @@ protected function buildUrl($path, array $options = []) { // The URL generator service is not necessarily available yet; e.g., in // interactive installer tests. elseif (\Drupal::hasService('url_generator')) { // Strip $base_path, if existent. $length = strlen($base_path); if (substr($path, 0, $length) === $base_path) { $path = substr($path, $length); } $force_internal = isset($options['external']) && $options['external'] == FALSE; if (!$force_internal && UrlHelper::isExternal($path)) { return Url::fromUri($path, $options)->toString(); Loading