From ae533160c9bec469bf890e4a08e0b0b7e8787bd4 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 30 Sep 2025 08:01:17 -0700 Subject: [PATCH] Fix test --- ProcessMaker/Jobs/RefreshArtisanCaches.php | 7 +++++++ tests/TestCase.php | 12 ------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/ProcessMaker/Jobs/RefreshArtisanCaches.php b/ProcessMaker/Jobs/RefreshArtisanCaches.php index 0ca44566dc..930441c631 100644 --- a/ProcessMaker/Jobs/RefreshArtisanCaches.php +++ b/ProcessMaker/Jobs/RefreshArtisanCaches.php @@ -42,6 +42,13 @@ public function middleware(): array */ public function handle() { + // Skip in testing environment because this reconnects the database + // meaning we loose transactions, and sets the console output verbosity + // to quiet so we loose expectsOutput assertions. + if (app()->environment('testing')) { + return; + } + $options = [ '--no-interaction' => true, '--quiet' => true, diff --git a/tests/TestCase.php b/tests/TestCase.php index 1e8be54cbd..33c1b10809 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -134,18 +134,6 @@ public function setUpMockScriptRunners(): void config()->set('script-runners.php-nayra.runner', 'MockRunner'); } - /** - * Calling the real config:cache command reconnects the database - * and since we're using transactions for our tests, we lose any data - * saved before the command is run. Instead, mock it out here. - */ - public function setUpMockConfigCache(): void - { - Bus::fake([ - RefreshArtisanCaches::class, - ]); - } - /** * Run additional tearDowns from traits. */