function WebTestBaseTest::providerTestGetAbsoluteUrl

Provides test data for testGetAbsoluteUrl.

Return value

array

File

core/modules/simpletest/tests/src/Unit/WebTestBaseTest.php, line 226

Class

WebTestBaseTest
@requires extension curl @coversDefaultClass <a href="/api/drupal/core%21modules%21simpletest%21src%21WebTestBase.php/class/WebTestBase/8.9.x" title="Test case for typical Drupal tests." class="local">\Drupal\simpletest\WebTestBase</a> @group simpletest @group WebTestBase

Namespace

Drupal\Tests\simpletest\Unit

Code

public function providerTestGetAbsoluteUrl() {
    $data = [];
    $data['host'] = [
        'http://example.com/drupal/test-example',
        'http://example.com/drupal/test-example',
    ];
    $data['path'] = [
        '/drupal/test-example',
        'http://example.com/drupal/test-example',
    ];
    $data['path-with-query'] = [
        '/drupal/test-example?foo=bar',
        'http://example.com/drupal/test-example?foo=bar',
    ];
    $data['just-query'] = [
        '?foo=bar',
        'http://example.com/drupal/current-path?foo=bar',
    ];
    return $data;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.