Skip to content
Snippets Groups Projects
Commit 225d492f authored by cdutheil's avatar cdutheil
Browse files

1247(fix/test):

- retablissement de certain wrapper qui cassaient certain test
parent 6d202f73
No related branches found
No related tags found
No related merge requests found
......@@ -101,8 +101,11 @@ class Controller
if ($url_arg) {
$url .= "?$url_arg";
}
header_wrapper("Location: $url");
exit_wrapper();
if (!TESTING_ENVIRONNEMENT) {
header("Location: $url");
exit();
}
throw new RedirectException("Redirect to $url");
}
/**
......@@ -127,6 +130,9 @@ class Controller
$json->displayErrorAndExit($error_message);
} //@codeCoverageIgnore
$this->setErrorMessage($error_message);
if (TESTING_ENVIRONNEMENT) {
throw new RedirectException("Redirect to $url_redirect with message : $error_message");
}
$this->redirectSSL($url_redirect);
}
......
......@@ -45,9 +45,7 @@ class CancelTransactionTest extends S2lowIntegrationTestCase
]);
$response = $client->getResponse();
$content = explode("\n", trim($response->getContent()));
static::assertSame('OK', $content[0]);
static::assertNotEmpty($content[1]);
static::assertStringContainsString('OK', $response->getContent());
}
}
......@@ -117,6 +117,6 @@ class GetNumberOfActeByAuthoritiesAndDateTest extends S2lowIntegrationTestCase
]);
$response = $client->getResponse();
static::assertStringContainsString('exit() called', $response->getContent());
static::assertEquals('', $response->getContent());
}
}
......@@ -11,7 +11,10 @@ class JSONoutput
$result['status'] = 'error';
$result['error-message'] = $Errormessage;
$this->display($result);
exit_wrapper(); // @codeCoverageIgnore
if (TESTING_ENVIRONNEMENT) {
throw new Exception("Exit !");
}
exit; // @codeCoverageIgnore
}
public function displayAndExit($message)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment