Skip to content

Commit

Permalink
Merge pull request #3910 from ushahidi/revert-3880-test-gwcheck
Browse files Browse the repository at this point in the history
Revert "test: gateway checker"
  • Loading branch information
rowasc authored Apr 2, 2020
2 parents f00e40b + 5192830 commit fce9c12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 101 deletions.
36 changes: 3 additions & 33 deletions tests/integration/bootstrap/RestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ class RestContext implements Context
private $restObjectType = null;
private $restObjectMethod = 'get';
private $client = null;
/**
* @var \GuzzleHttp\Psr7\Response
*/
private $response = null;
private $requestUrl = null;
private $apiUrl = 'api/v3';
Expand All @@ -40,8 +37,6 @@ class RestContext implements Context
private $postFields = [];
private $postFiles = [];

const DEBUG_MODE_SWITCH_FILE_PATH = __DIR__ . "/../../../bootstrap/install_debug_mode.enabled";

/**
* Initializes context.
* Every scenario gets it's own context object.
Expand Down Expand Up @@ -206,24 +201,6 @@ public function thatThePostFileIs($fieldName, $fieldValue)
$this->postFiles[$fieldName] = $fieldValue;
}

/**
* @Given /^that I have enabled debug mode$/
*/
public function thatIHaveEnabledDebugMode()
{
fopen(self::DEBUG_MODE_SWITCH_FILE_PATH, "w");
}

/**
* @AfterScenario
* @Given /^that I have disabled debug mode$/
*/
public function disableDebugModeAfterScenario()
{
if (file_exists(self::DEBUG_MODE_SWITCH_FILE_PATH)) {
unlink(self::DEBUG_MODE_SWITCH_FILE_PATH);
}
}
/**
* @When /^I request "([^"]*)"$/
*/
Expand All @@ -234,9 +211,9 @@ public function iRequest($pageUrl)
switch (strtoupper($this->restObjectMethod)) {
case 'GET':
$request = (array)$this->restObject;
$idAttachment = ( isset($request['id']) ) ? "/" . $request['id'] : '';
$id = ( isset($request['id']) ) ? $request['id'] : '';
$response = $this->client
->get($this->requestUrl.$idAttachment, [
->get($this->requestUrl.'/'.$id, [
'query' => isset($request['query string']) ? trim($request['query string']) : null,
'headers' => $this->headers
]);
Expand Down Expand Up @@ -426,13 +403,6 @@ public function theResponseIsJsonp()
}
}

/**
* @Then /^the response is empty/
*/
public function theResponseIsEmpty()
{
\PHPUnit_Framework_Assert::assertEquals(0, $this->response->getBody()->getSize());
}
/**
* @Given /^the response has a "([^"]*)" property$/
* @Given /^the response has an "([^"]*)" property$/
Expand Down Expand Up @@ -661,7 +631,7 @@ public function thePropertyIsEmpty($propertyName)
$actualPropertyValue = array_get($data, $propertyName);

if (!empty($actualPropertyValue)) {
throw new \Exception("Property '{$propertyName}' is not empty but '{$actualPropertyValue}'\n");
throw new \Exception("Property '{$propertyName}' is not empty!\n");
}
}

Expand Down
68 changes: 0 additions & 68 deletions tests/integration/gwchecker.feature

This file was deleted.

0 comments on commit fce9c12

Please sign in to comment.