diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 339b041d1..0f3b85d20 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -974,11 +974,9 @@ class FeatureContext implements Context, SnippetAcceptingContext { $deleted = false; $this->deleteUser($user); - try { - $this->userExists($user); - } catch (ClientException $ex) { - $deleted = true; - } + + $response = $this->userExists($user); + $deleted = $response->getStatusCode() === 404; if (!$deleted) { Assert::fail("User $user exists"); diff --git a/tests/integration/features/bootstrap/SharingContext.php b/tests/integration/features/bootstrap/SharingContext.php index b6b00e1c4..b14a90aca 100644 --- a/tests/integration/features/bootstrap/SharingContext.php +++ b/tests/integration/features/bootstrap/SharingContext.php @@ -25,7 +25,7 @@ use Behat\Behat\Context\Context; use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Client; use GuzzleHttp\Cookie\CookieJar; -use GuzzleHttp\Message\ResponseInterface; +use Psr\Http\Message\ResponseInterface; class SharingContext implements Context { @@ -511,7 +511,7 @@ class SharingContext implements Context { // Clean opcode cache $client = new GuzzleHttp\Client(); - $client->send($client->createRequest('GET', $this->baseUrl . '/apps/testing/clean_opcode_cache.php')); + $client->request('GET', $this->baseUrl . '/apps/testing/clean_opcode_cache.php'); \PHPUnit\Framework\Assert::assertEquals(0, $lastCode); }