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

Add simple mocked response object to httpResponse property on ResultMockFactory #1776

Conversation

AlexJump24
Copy link
Contributor

Hello,

I am writing some tests using the ResultMockFactory on the SsmClient. This all works great but as part of the application code we are calling the following method on the result mock class.

$parameterResult->info()['response']->getStatusCode()

This goes through to the info() method on the AsyncAws\Core\Response class where the httpResponse property is null, so the test then attempts to call getInfo() on null.

I have been following https://async-aws.com/features/tests.html and I have tried to figure out if I can add the response data in any other way but I can't see this being possible.

So I have set the SimpleMockedResponse object as the httpResponse property on the class and it now returns 200 as expected. I felt this was the most appropriate class to use, but I may be wrong.

@jderusse jderusse merged commit deb5aeb into async-aws:master Oct 9, 2024
16 checks passed
@jderusse
Copy link
Member

jderusse commented Oct 9, 2024

Thanks

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.

2 participants