class TestClient
Special client that can return a given response on the first doRequest().
Hierarchy
- class \Drupal\BuildTests\Framework\DrupalMinkClient extends \Behat\Mink\Driver\Goutte\Client
- class \Drupal\BuildTests\Framework\Tests\TestClient extends \Drupal\BuildTests\Framework\DrupalMinkClient
Expanded class hierarchy of TestClient
File
-
core/
tests/ Drupal/ BuildTests/ Framework/ Tests/ DrupalMinkClientTest.php, line 82
Namespace
Drupal\BuildTests\Framework\TestsView source
class TestClient extends DrupalMinkClient {
protected $nextResponse = NULL;
public function setNextResponse(Response $response) {
$this->nextResponse = $response;
}
protected function doRequest($request) {
if (NULL === $this->nextResponse) {
return new Response();
}
$response = $this->nextResponse;
$this->nextResponse = NULL;
return $response;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
DrupalMinkClient::$followMetaRefresh | protected | property | Whether to follow meta redirects or not. |
DrupalMinkClient::followMetaRefresh | public | function | Sets whether to automatically follow meta refresh redirects or not. |
DrupalMinkClient::getMetaRefreshUrl | private | function | Glean the meta refresh URL from the current page content. |
DrupalMinkClient::request | public | function | |
TestClient::$nextResponse | protected | property | |
TestClient::doRequest | protected | function | |
TestClient::setNextResponse | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.