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 helper method to set service mocks in the container. #646

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

maximium
Copy link

@maximium maximium commented Feb 5, 2025

Handy helper to mock services in the container when doing command tests.

@alexislefebvre
Copy link
Collaborator

Could you please apply the changes suggested by PHP-CS-Fixer ?

doc/command.md Outdated
@@ -46,4 +46,34 @@ class MyTestCase extends WebTestCase {
}
```

If you need to mock a service in your command, you can use the `setServiceMock` method.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it work only for commands? Otherwise this text may be added here: https://github.com/liip/LiipFunctionalTestBundle/blob/master/doc/basic.md

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure. It'll take some time to work on it.

Copy link
Author

Choose a reason for hiding this comment

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

I've added more tests and documentation, about the non-obvious nuances of the setMockService method usage.

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