diff --git a/tests/Mock/MockPsTools.php b/tests/Mock/MockPsTools.php index d5364dc6..9ca35be8 100644 --- a/tests/Mock/MockPsTools.php +++ b/tests/Mock/MockPsTools.php @@ -30,6 +30,11 @@ public static function getValue(string $key) return self::$values[$key] ?? null; } + public static function reset(): void + { + self::$values = []; + } + /** * @param array $values * diff --git a/tests/Pest.php b/tests/Pest.php index 7d90b93d..f1584472 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -8,6 +8,7 @@ * @see https://pestphp.com/docs/underlying-test-case#testspestphp */ +use MyParcelNL\PrestaShop\Tests\Mock\MockPsTools; use MyParcelNL\PrestaShop\Tests\TestCase; /** @see \MyParcelNL\PrestaShop\bootPdk() */ @@ -29,7 +30,17 @@ const _PS_VERSION_ = '8.0.0'; const _PS_USE_SQL_SLAVE_ = false; -uses(TestCase::class)->in(__DIR__); +uses(TestCase::class) + ->afterEach(function () { + $resetInterfaces = [ + MockPsTools::class, + ]; + + foreach ($resetInterfaces as $resetInterface) { + $resetInterface::reset(); + } + }) + ->in(__DIR__); uses() ->group('migrations')