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