assertFalse($exceptionWithoutRedirect->hasRedirect()); $exceptionWithRedirect = OAuthServerException::accessDenied('some hint', 'https://example.com/error'); $this->assertTrue($exceptionWithRedirect->hasRedirect()); } }