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

Skip post_migrate when running tests #1193

Merged
merged 5 commits into from
Mar 23, 2021

Conversation

netpok
Copy link
Contributor

@netpok netpok commented Mar 22, 2021

Summary

This PR skips post migrate hooks when application is running unit tests. This should not cause any problems but it's unnecessary to generate the helpers hundred times. Also test should not have a sideeffect.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Add a CHANGELOG.md entry
  • Code style has been fixed via composer fix-style

@@ -35,7 +34,7 @@ class IdeHelperServiceProvider extends ServiceProvider implements DeferrableProv
*/
public function boot()
{
if ($this->app['config']->get('ide-helper.post_migrate', [])) {
if (!$this->app->runningUnitTests() && $this->app['config']->get('ide-helper.post_migrate', [])) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this work with Lumen? 😬

Copy link
Contributor Author

@netpok netpok Mar 22, 2021

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you, LGTM!

Could you please resolve the merge conflicts? Don't see any blockerS!

Copy link
Collaborator

@mfn mfn left a comment

Choose a reason for hiding this comment

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

Thank you!

@mfn mfn merged commit b8d5fc3 into barryvdh:master Mar 23, 2021
@netpok netpok deleted the skip_generate_in_phpunit branch April 15, 2021 20:05
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