/** * Check if mandatory OAuth parameters are present. * * @param array $protocolParams * @param array $requiredParams * @return void * @throws OauthInputException */ protected function _checkRequiredParams($protocolParams, $requiredParams) { $exception = new OauthInputException(); foreach ($requiredParams as $param) { if (!isset($protocolParams[$param])) { $exception->addError(new Phrase(OauthInputException::REQUIRED_FIELD, ['fieldName' => $param])); } } if ($exception->wasErrorAdded()) { throw $exception; } }
/** * @return void */ public function testGetAggregatedErrorMessageNoError() { $exception = new OauthInputException(); $this->assertEquals('', $exception->getAggregatedErrorMessage()); }