diff --git a/src/Test/WebTestCase.php b/src/Test/WebTestCase.php index da4f3f6..ccb56a6 100644 --- a/src/Test/WebTestCase.php +++ b/src/Test/WebTestCase.php @@ -7,16 +7,17 @@ abstract class WebTestCase extends FixturesAwareTestCase { + /** @var KernelBrowser $client */ + private $client; + final protected function doRequest(RequestBuilder $builder): Response { $this->initClient(); - /** @var KernelBrowser $client */ - $client = static::$client; - - $client->request(...$builder->build()); + $this->client->request(...$builder->build()); - $response = $client->getResponse(); + /** @var Response $response */ + $response = $this->client->getResponse(); // Since there is no content, then there is also no content-type header. if ($response->getStatusCode() !== Response::HTTP_NO_CONTENT) { @@ -33,8 +34,8 @@ final protected function doRequest(RequestBuilder $builder): Response private function initClient() : void { - if (!static::$client) { - static::createClient(); + if (!$this->client) { + $this->client = static::createClient(); } } }