summaryrefslogtreecommitdiffstats
path: root/application/tests/Test.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/tests/Test.php')
-rw-r--r--application/tests/Test.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/application/tests/Test.php b/application/tests/Test.php
index 81225b312..192061db9 100644
--- a/application/tests/Test.php
+++ b/application/tests/Test.php
@@ -66,9 +66,9 @@ abstract class Test {
return $json;
}
- protected function expectSuccess($testname, $reply)
+ protected function excpectStatus($testname, $reply, $status)
{
- if (!isset($reply["status"]) || $reply["status"] != "success") {
+ if (!isset($reply["status"]) || $reply["status"] != $status) {
$this->t->fail($testname);
$this->diagReply($reply);
} else {
@@ -77,6 +77,16 @@ abstract class Test {
return $reply;
}
+ protected function expectSuccess($testname, $reply)
+ {
+ return $this->excpectStatus($testname, $reply, "success");
+ }
+
+ protected function expectError($testname, $reply)
+ {
+ return $this->excpectStatus($testname, $reply, "error");
+ }
+
protected function diagReply($reply)
{
$this->t->diag("Request got unexpected response:");