Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update callback verification in HttpRequest. #769

Merged
merged 4 commits into from
Jul 25, 2024

Conversation

midnite81
Copy link
Contributor

Changes

'callback' is a property not a method of $mockedResponse

Changed the method_exists check to a property_exists check in the HttpRequest class. This adjustment ensures that 'callback' is an accessible property of the object before attempting to invoke it. This change improves code reliability, specifically for the cases where HttpRequest is used in unit tests with mock responses.

References

#768 Callback Never Called

Testing

A test has been added to assert the fix is working as expected

Contributor Checklist

…ot a method of $mockedResponse

Changed the method_exists check to a property_exists check in the HttpRequest class. This adjustment ensures that 'callback' is an accessible property of the object before attempting to invoke it. This change improves code reliability, specifically for the cases where HttpRequest is used in unit tests with mock responses.
A new test case 'the callback of a mock response is called' was added to further ensure the robustness of the application.
Copy link
Member

@evansims evansims left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for catching that, @midnite81!

@evansims evansims merged commit 96c4f34 into auth0:main Jul 25, 2024
24 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants