From b0babfc847e6bf232e31caf64182c5c571732954 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 6 Oct 2015 10:29:33 +0200 Subject: [PATCH] [Intergration] Throw error if exception not thrown --- .../features/bootstrap/FeatureContext.php | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index ec181206259..9676fc8ca40 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -58,9 +58,6 @@ class FeatureContext extends BehatContext { return $response->xml()->meta[0]->statuscode; } - - - /** * @Then /^the OCS status code should be "([^"]*)"$/ */ @@ -68,7 +65,6 @@ class FeatureContext extends BehatContext { PHPUnit_Framework_Assert::assertEquals($statusCode, $this->getOCSResponse($this->response)); } - /** * @Then /^the HTTP status code should be "([^"]*)"$/ */ @@ -76,9 +72,6 @@ class FeatureContext extends BehatContext { PHPUnit_Framework_Assert::assertEquals($statusCode, $this->response->getStatusCode()); } - - - /** * @Given /^As an "([^"]*)"$/ */ @@ -114,13 +107,13 @@ class FeatureContext extends BehatContext { public function userDoesNotExist($user) { try { $this->userExists($user); + PHPUnit_Framework_Assert::fail('The user "' . $user . '" exists'); } catch (\GuzzleHttp\Exception\ClientException $ex) { $this->response = $ex->getResponse(); PHPUnit_Framework_Assert::assertEquals(404, $ex->getResponse()->getStatusCode()); } } - /** * @When /^creating the user "([^"]*)r"$/ */ @@ -141,7 +134,6 @@ class FeatureContext extends BehatContext { } - /** * @When /^creating the group "([^"]*)r"$/ */ @@ -160,7 +152,6 @@ class FeatureContext extends BehatContext { ]); } - /** * @Given /^group "([^"]*)" exists$/ */ @@ -182,13 +173,13 @@ class FeatureContext extends BehatContext { public function groupDoesNotExist($group) { try { $this->groupExists($group); + PHPUnit_Framework_Assert::fail('The group "' . $group . '" exists'); } catch (\GuzzleHttp\Exception\ClientException $ex) { $this->response = $ex->getResponse(); PHPUnit_Framework_Assert::assertEquals(404, $ex->getResponse()->getStatusCode()); } } - /** * @When /^sending "([^"]*)" to "([^"]*)" with$/ * @param \Behat\Gherkin\Node\TableNode|null $formData @@ -211,10 +202,4 @@ class FeatureContext extends BehatContext { $this->response = $ex->getResponse(); } } - - - - - - }