/** * {@inhertidoc} * @see \InoOicClient\Oic\ErrorFactoryInterface::createError() */ public function createError($code, $description = null, $uri = null) { $error = new Error(); $error->setCode($code); if (null !== $description) { $error->setDescription($description); } if (null !== $uri) { $error->setUri($uri); } return $error; }
public function testGettersAndSetters() { $code = 'error'; $description = 'error description'; $uri = 'http://example.org/error'; $errorResponse = new Error(); $errorResponse->setCode($code); $errorResponse->setDescription($description); $errorResponse->setUri($uri); $this->assertSame($code, $errorResponse->getCode()); $this->assertSame($description, $errorResponse->getDescription()); $this->assertSame($uri, $errorResponse->getUri()); }