public function testUsesTypeFromExceptionWhenProvided() { $exception = new Exception\DomainException('exception message', 401); $exception->setType('http://example.com/api/help/401'); $apiProblem = new ApiProblem('401', $exception); $payload = $apiProblem->toArray(); $this->assertArrayHasKey('type', $payload); $this->assertEquals($exception->getType(), $payload['type']); }