File tree Expand file tree Collapse file tree 2 files changed +37
-10
lines changed
Expand file tree Collapse file tree 2 files changed +37
-10
lines changed Original file line number Diff line number Diff line change 22
33namespace MarcoRieser \Livewire \Tests ;
44
5- use Illuminate \Support \Arr ;
65use Livewire \LivewireServiceProvider ;
76use MarcoRieser \Livewire \ServiceProvider ;
87use Spatie \LaravelRay \RayServiceProvider ;
@@ -25,15 +24,6 @@ protected function getPackageProviders($app): array
2524 );
2625 }
2726
28- protected function setConfigValue (string $ key , $ value ): void
29- {
30- $ config = config ()->array ('statamic-livewire ' , require __DIR__ .'/../config/statamic-livewire.php ' );
31-
32- Arr::set ($ config , $ key , $ value );
33-
34- config ()->set ('statamic-livewire ' , $ config );
35- }
36-
3727 protected function setUp (): void
3828 {
3929 parent ::setUp ();
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace MarcoRieser \Livewire \Tests \Traits ;
4+
5+ use Illuminate \Support \Arr ;
6+
7+ trait ManipulateAddonConfig
8+ {
9+ protected function enableSynthesizers (): void
10+ {
11+ $ this ->setConfigValue ('synthesizers.enabled ' , true );
12+ }
13+
14+ protected function disableSynthesizers (): void
15+ {
16+ $ this ->setConfigValue ('synthesizers.enabled ' , false );
17+ }
18+
19+ protected function disableSynthesizerTransform (): void
20+ {
21+ $ this ->setConfigValue ('synthesizers.transform ' , false );
22+ }
23+
24+ protected function enableSynthesizerTransform (): void
25+ {
26+ $ this ->setConfigValue ('synthesizers.transform ' , true );
27+ }
28+
29+ protected function setConfigValue (string $ key , $ value ): void
30+ {
31+ $ config = config ()->array ('statamic-livewire ' , require __DIR__ .'/../../config/statamic-livewire.php ' );
32+
33+ Arr::set ($ config , $ key , $ value );
34+
35+ config ()->set ('statamic-livewire ' , $ config );
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments