You are here

public function DrupalMinkClientTest::testFollowMetaRefresh in Drupal 8

@dataProvider getTestsForMetaRefresh @covers ::getMetaRefreshUrl

File

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

Class

DrupalMinkClientTest
Test \Drupal\BuildTests\Framework\DrupalMinkClient.

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());
}