class TestClient in Drupal 8
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
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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalMinkClient:: |
protected | property | Whether to follow meta redirects or not. | |
DrupalMinkClient:: |
public | function | Sets whether to automatically follow meta refresh redirects or not. | |
DrupalMinkClient:: |
private | function | Glean the meta refresh URL from the current page content. | |
DrupalMinkClient:: |
public | function | Calls a URI. | |
TestClient:: |
protected | property | ||
TestClient:: |
protected | function | Makes a request. | |
TestClient:: |
public | function |