public function testFormatterNotFound() { $formatter = RequestFormatter::create('fake_module', 'fake_method'); $data = array('key1' => 'value1', 'key2' => 'value2'); $this->assertInstanceOf('\\Humantech\\Zoho\\Recruit\\Api\\Formatter\\RequestFormatter', $formatter->formatter($data)); $this->assertEquals($data, $formatter->getOutput()); }
/** * @inheritdoc */ public function updateRecords($module, $id, $data, array $additionalParams = array(), $responseFormat = self::API_RESPONSE_FORMAT_JSON) { $method = 'updateRecords'; $additionalParams['id'] = $id; $additionalParams['xmlData'] = RequestFormatter::create($module, 'updateRecords')->formatter($data)->getOutput(); $response = $this->sendRequest('POST', $this->getUri($module, $method, $responseFormat, $additionalParams)); $unserializedData = $this->getUnserializedData($response, $responseFormat); return ResponseFormatter::create($module, $method)->formatter($unserializedData)->getOutput(); }