You are here

protected static function ApigeeEdgeFunctionalTestTrait::fixUrl in Apigee Edge 8

Returns absolute URL starts with a slash.

Parameters

string $url: The URL.

Return value

string URL starts with a slash, if the URL is absolute.

2 calls to ApigeeEdgeFunctionalTestTrait::fixUrl()
ApigeeEdgeFunctionalTestTrait::clickLinkProperly in tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php
Implements link clicking properly.
DeveloperAppPermissionTest::assertPermission in tests/src/Functional/DeveloperAppPermissionTest.php
Asserts that an account with a given permission can or can't access pages.

File

tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php, line 285

Class

ApigeeEdgeFunctionalTestTrait
Provides common functionality for the Apigee Edge test classes.

Namespace

Drupal\Tests\apigee_edge\Traits

Code

protected static function fixUrl(string $url) : string {
  if (mb_strpos($url, 'http:') === 0 || mb_strpos($url, 'https:') === 0) {
    return $url;
  }
  return mb_strpos($url, '/') === 0 ? $url : "/{$url}";
}