From 15738599323296f4913f9842f70ccbe49c95e94b Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Mon, 2 Sep 2024 18:53:41 -0400 Subject: [PATCH] Attempt fix without skipping test. --- tests/Command/InstallTest.php | 5 ++++- tests/TestCase.php | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/Command/InstallTest.php b/tests/Command/InstallTest.php index c6db2cc..2be26aa 100644 --- a/tests/Command/InstallTest.php +++ b/tests/Command/InstallTest.php @@ -51,8 +51,11 @@ expect($after)->toEqual(config('ddd.domain_path')); unlink(config_path('ddd.php')); + + // Reset composer back to the factory state + $this->setDomainPathInComposer('Domain', 'src/Domain', reload: true); })->with([ ['src/Domain', 'Domain'], ['src/Domains', 'Domains'], ['src/CustomDomainRoot', 'CustomDomainRoot'], -])->skip('Causes issues with autoload tests executed after this test'); +]); diff --git a/tests/TestCase.php b/tests/TestCase.php index 515bb72..fb69cab 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -167,7 +167,7 @@ protected function setupTestApplication() $this->setDomainPathInComposer('Domain', 'src/Domain'); } - protected function setDomainPathInComposer($domainNamespace, $domainPath) + protected function setDomainPathInComposer($domainNamespace, $domainPath, bool $reload = true) { $this->updateComposer( set: [ @@ -175,6 +175,10 @@ protected function setDomainPathInComposer($domainNamespace, $domainPath) ], ); + if ($reload) { + $this->composerReload(); + } + return $this; } }