summaryrefslogtreecommitdiff
path: root/tests/TestBaseApi.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-03-28 08:34:12 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-03-28 08:34:12 +0200
commita5bd7789297378be3fb8dc3814c6649ea82a88d8 (patch)
tree1aa8aaed712641d5af822c90fb57aa7a0aa8d9e4 /tests/TestBaseApi.php
parent1dfff5d3d81fdb67e4c78136168801a488fcf139 (diff)
downloadsemanticscuttle-a5bd7789297378be3fb8dc3814c6649ea82a88d8.tar.gz
semanticscuttle-a5bd7789297378be3fb8dc3814c6649ea82a88d8.tar.bz2
introduce assertResponseJson200 for API/ajax tests and use it
Diffstat (limited to 'tests/TestBaseApi.php')
-rw-r--r--tests/TestBaseApi.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/TestBaseApi.php b/tests/TestBaseApi.php
index 2341ea1..f054973 100644
--- a/tests/TestBaseApi.php
+++ b/tests/TestBaseApi.php
@@ -173,6 +173,25 @@ class TestBaseApi extends TestBase
/**
+ * Verifies that the HTTP response has status code 200 and
+ * content-type application/json; charset=utf-8
+ *
+ * @param HTTP_Request2_Response $res HTTP Response object
+ *
+ * @return void
+ */
+ protected function assertResponseJson200(HTTP_Request2_Response $res)
+ {
+ $this->assertEquals(200, $res->getStatus());
+ $this->assertEquals(
+ 'application/json; charset=utf-8',
+ $res->getHeader('content-type')
+ );
+ }
+
+
+
+ /**
* Writes a special unittest configuration file.
* The unittest config file is read when a GET request with unittestMode=1
* is sent, and the user allowed unittestmode in config.php.