Skip to content

Commit

Permalink
fix(testing): always clear cache in integration test's tearDown (#3818)
Browse files Browse the repository at this point in the history
This prevent tests from interacting between each other through the cache.
  • Loading branch information
n-peugnet authored May 2, 2023
1 parent d7fcd8a commit 3264455
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions php-packages/testing/src/integration/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Flarum\Testing\integration\Extend\BeginTransactionAndSetDatabase;
use Flarum\Testing\integration\Extend\OverrideExtensionManagerForTests;
use Flarum\Testing\integration\Extend\SetSettingsBeforeBoot;
use Illuminate\Contracts\Cache\Store;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Support\Arr;
use Laminas\Diactoros\ServerRequest;
Expand All @@ -36,6 +37,7 @@ protected function tearDown(): void
parent::tearDown();

$this->database()->rollBack();
$this->app()->getContainer()->make(Store::class)->flush();
}

/**
Expand Down

0 comments on commit 3264455

Please # to comment.