From fab902567ae8201e848bc9c220fb28319fd0b049 Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Sun, 17 Nov 2024 20:09:54 -0500 Subject: [PATCH] Disable laravel-data caching in test environtment globally. --- tests/Command/OptimizeTest.php | 7 ------- tests/TestCase.php | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/Command/OptimizeTest.php b/tests/Command/OptimizeTest.php index c854c89..49ab16e 100644 --- a/tests/Command/OptimizeTest.php +++ b/tests/Command/OptimizeTest.php @@ -12,19 +12,12 @@ DomainCache::clear(); $this->originalComposerContents = file_get_contents(base_path('composer.json')); - - // $this->artisan('clear-compiled')->assertSuccessful()->execute(); - // $this->artisan('optimize:clear')->assertSuccessful()->execute(); - config()->set('data.structure_caching.enabled', false); }); afterEach(function () { DomainCache::clear(); file_put_contents(base_path('composer.json'), $this->originalComposerContents); - - // $this->artisan('clear-compiled')->assertSuccessful()->execute(); - // $this->artisan('optimize:clear')->assertSuccessful()->execute(); }); it('can optimize discovered domain providers, commands, migrations', function () { diff --git a/tests/TestCase.php b/tests/TestCase.php index c86b26d..4063b5d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -31,6 +31,8 @@ protected function setUp(): void ); DomainCache::clear(); + + config()->set('data.structure_caching.enabled', false); }); $this->beforeApplicationDestroyed(function () { @@ -90,6 +92,7 @@ protected function defineEnvironment($app) ], 'ddd.cache_directory' => 'bootstrap/cache/ddd', 'cache.default' => 'file', + 'data.structure_caching.enabled' => false, ...static::$configValues, ]; }