[Intergration] Throw error if exception not thrown

This commit is contained in:
Roeland Jago Douma 2015-10-06 10:29:33 +02:00
parent 6e5aae2608
commit b0babfc847
1 changed files with 2 additions and 17 deletions

View File

@ -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();
}
}
}