/** * make it look to the component as if it is receiving * a request for a method invocation and check the response * is correct */ public function testWrapperAndProxy() { $_SERVER['HTTP_HOST'] = 'localhost'; $_SERVER['REQUEST_METHOD'] = 'POST'; $_SERVER['SCRIPT_FILENAME'] = 'TestService.php'; $_SERVER['REQUEST_URI'] = 'http://localhost/TestService.php'; $_SERVER['CONTENT_TYPE'] = 'application/json-rpc'; SCA_JsonRpcServer::$test_request = $this->request; SCA_JsonRpcClient::$store_test_request = true; SCA_JsonRpcClient::$test_response = $this->email_response; ob_start(); SCA::initComponent("TestService.php"); $out = ob_get_contents(); ob_end_clean(); $this->assertContains($this->response, $out); $this->assertContains(SCA_JsonRpcClient::$test_request, $this->email_request); }