function DrupalMinkClientTest::testFollowMetaRefresh

@dataProvider getTestsForMetaRefresh @covers ::getMetaRefreshUrl

File

core/tests/Drupal/BuildTests/Framework/Tests/DrupalMinkClientTest.php, line 24

Class

DrupalMinkClientTest
Test <a href="/api/drupal/core%21tests%21Drupal%21BuildTests%21Framework%21DrupalMinkClient.php/class/DrupalMinkClient/8.9.x" title="Extend the Mink client for Drupal use-cases." class="local">\Drupal\BuildTests\Framework\DrupalMinkClient</a>.

Namespace

Drupal\BuildTests\Framework\Tests

Code

public function testFollowMetaRefresh(string $content, string $expectedEndingUrl, bool $followMetaRefresh = TRUE) {
    $client = new TestClient();
    $client->followMetaRefresh($followMetaRefresh);
    $client->setNextResponse(new Response($content));
    $client->request('GET', 'http://www.example.com/foo/foobar');
    $this->assertEquals($expectedEndingUrl, $client->getRequest()
        ->getUri());
}

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