Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

(V1) Fix | Use of null in MockResponse data #231

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

Sammyjo20
Copy link
Member

Fixes #213

This PR fixes an issue with v1's mock responses if you were to use null as the data of the mock response, it would throw an exception.

Copy link
Member Author

@Sammyjo20 Sammyjo20 left a comment

Choose a reason for hiding this comment

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

Self review

@what-the-diff
Copy link

what-the-diff bot commented Jun 6, 2023

PR Summary 😊

  • Improved getFormattedData method
    The getFormattedData method now returns null if there's no data, making it smarter! 🧠
  • Changed getHeader return type
    The getHeader return type is updated from array to string, and it returns an empty string if no header is found. This makes it more consistent. 🌟
  • Fixed comment typo in CollectsData
    A small typo fix in the docblock comment to improve code readability. 📚
  • Added a test case for MockClient constructor
    A new test case is added to check if null as the response body is treated like an empty string. This helps ensure code reliability. 🧪

@Sammyjo20 Sammyjo20 changed the title (V1) Fix | Usenull in MockResponse data (V1) Fix | Use of null in MockResponse data Jun 6, 2023
@Sammyjo20 Sammyjo20 merged commit 38ecead into v1 Jun 6, 2023
@Sammyjo20 Sammyjo20 deleted the fix/support-null-mock-responses branch June 23, 2023 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant