Skip to content

Commit

Permalink
Disable laravel-data caching in test environtment globally.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperTey committed Nov 18, 2024
1 parent 62eee63 commit fab9025
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 0 additions & 7 deletions tests/Command/OptimizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
3 changes: 3 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ protected function setUp(): void
);

DomainCache::clear();

config()->set('data.structure_caching.enabled', false);
});

$this->beforeApplicationDestroyed(function () {
Expand Down Expand Up @@ -90,6 +92,7 @@ protected function defineEnvironment($app)
],
'ddd.cache_directory' => 'bootstrap/cache/ddd',
'cache.default' => 'file',
'data.structure_caching.enabled' => false,
...static::$configValues,
];
}
Expand Down

0 comments on commit fab9025

Please sign in to comment.