diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-02-06 12:42:08 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-02-06 12:42:08 +0100 |
commit | 5b225c751d60d79916da4a7db761f823e12148de (patch) | |
tree | 1cf1231f8fb7e69bc1921fb52cd819ac6dfa3f08 /application/tests/Test.php | |
parent | f5cab9d96aec1464978b556f2ca02e79b2c4d8d8 (diff) |
Add more tests
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/tests/Test.php')
-rw-r--r-- | application/tests/Test.php | 14 |
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:"); |