/** * @param array $config * @return RestRequest */ protected function getAuthRequest(array $config) { if (empty($config['endpoint'])) { throw new UserException('Request endpoint must be set for the Login authentication method.'); } if (!empty($config['params'])) { $config['params'] = UserFunction::build($config['params'], $this->params); } if (!empty($config['headers'])) { $config['headers'] = UserFunction::build($config['headers'], $this->params); } return RestRequest::create($config); }
/** * @expectedException \Keboola\Juicer\Exception\UserException * @expectedExceptionMessage Request params must be an array */ public function testValidateConfig() { $request = RestRequest::create(['endpoint' => 'ep', 'params' => 'string']); }
/** * @param array $config * @return RestRequest */ public function createRequest(array $config) { return RestRequest::create($this->getRequestConfig($config)); }