assertTrue($exceptionWithRedirect->hasRedirect()); } public function testDoesNotHaveRedirect() { $exceptionWithoutRedirect = OAuthServerException::accessDenied('Some hint'); $this->assertFalse($exceptionWithoutRedirect->hasRedirect()); } public function testHasPrevious() { $previous = new Exception('This is the previous'); $exceptionWithPrevious = OAuthServerException::accessDenied(null, null, $previous); $this->assertSame('This is the previous', $exceptionWithPrevious->getPrevious()->getMessage()); } public function testDoesNotHavePrevious() { $exceptionWithoutPrevious = OAuthServerException::accessDenied(); $this->assertNull($exceptionWithoutPrevious->getPrevious()); } }