function DrupalMinkClient::request

File

core/tests/Drupal/BuildTests/Framework/DrupalMinkClient.php, line 56

Class

DrupalMinkClient
Extend the Mink client for Drupal use-cases.

Namespace

Drupal\BuildTests\Framework

Code

public function request($method, $uri, array $parameters = [], array $files = [], array $server = [], $content = NULL, $changeHistory = TRUE) {
  $this->crawler = parent::request($method, $uri, $parameters, $files, $server, $content, $changeHistory);
  // Check for meta refresh redirect and follow it.
  if ($this->followMetaRefresh && NULL !== $redirect = $this->getMetaRefreshUrl()) {
    $this->redirect = $redirect;
    // $this->redirects is private on the BrowserKit client, so we have to use
    // reflection to manage the redirects stack.
    $ref_redirects = new \ReflectionProperty(SymfonyClient::class, 'redirects');
    $ref_redirects->setAccessible(TRUE);
    $redirects = $ref_redirects->getValue($this);
    $redirects[serialize($this->history
      ->current())] = TRUE;
    $ref_redirects->setValue($this, $redirects);
    $this->crawler = $this->followRedirect();
  }
  return $this->crawler;
}

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