public function testProperInstantiation() { global $_SERVER; // emulate client request $_SERVER["REQUEST_METHOD"] = "GET"; $_SERVER["SCRIPT_NAME"] = "/service.php"; $vo_response = new ResponseHTTP(); $vo_request = new RequestHTTP($vo_response, array("dont_create_new_session" => true)); $vo_request->setRawPostData('{"foo" : "bar"}'); $vo_request->setParameter("id", 4711, "GET"); $vo_service = new BaseJSONService($vo_request, "ca_objects"); $this->assertFalse($vo_service->hasErrors()); $this->assertEquals("ca_objects", $vo_service->getTableName()); $this->assertEquals("GET", $vo_service->getRequestMethod()); $this->assertEquals(4711, $vo_service->getIdentifier()); $this->assertEquals(array("foo" => "bar"), $vo_service->getRequestBodyArray()); }