-
-
Notifications
You must be signed in to change notification settings - Fork 839
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
Make it possible to extend SetupScript #3643
Make it possible to extend SetupScript #3643
Conversation
…pt and added public methods to add settings or extensions to in initial installation pipeline
What's the use case for this? I'd rather make sure the current codebase doesn't allow you to achieve your use case before making the change. |
Hi @SychO9 In my use-case, I needed to activate some extensions (like Also, I realized that making settings with This is now my $setup = (new SetupScript())
->addSettings([
'glowingblue-redis.enableCache' => true,
])
->addExtensions([
'flarum-tags',
'flarum-likes',
'glowingblue-redis-setup',
])
->run(); |
The Lookout for anything in your tests that could be causing your tests to boot the application earlier than you want, like resolving a class, or making manual database changes or an early request ..etc |
Yes I get that, so I need to change the code here : https://github.com/glowingblue/flarum-ext-redis-setup/blob/master/src/Extend/EnableRedis.php#L40 ? And what about the migrations that fail ? |
I don't know how that ties into the test code so I can't tell, maybe if you share the test code in the discord server |
I made the update as discussed over Discord @SychO9. If you want to make any adjustments to the docblock I wrote, let me know. |
Changes proposed in this pull request:
Make it possible to extend
Flarum\Testing\integration\Setup\SetupScript
and added a public method to add settings to the initial installation pipeline.New usage example:
As documented, the new method can be used to add settings to the Flarum installation.
Should be used only when it is really needed.
This can be useful in rare cases where the settings are required to be set already when extensions Extenders are executed. In those cases, setting the settings with the
setting()
method of theTestCase
will not work.Reviewers should focus on:
The new methods work and don't break any existing code.
Necessity
Confirmed
composer test
).