Skip to content

Commit

Permalink
Attempt fix without skipping test.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperTey committed Sep 2, 2024
1 parent ddc860f commit 1573859
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/Command/InstallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
]);
6 changes: 5 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,18 @@ protected function setupTestApplication()
$this->setDomainPathInComposer('Domain', 'src/Domain');
}

protected function setDomainPathInComposer($domainNamespace, $domainPath)
protected function setDomainPathInComposer($domainNamespace, $domainPath, bool $reload = true)
{
$this->updateComposer(
set: [
[['autoload', 'psr-4', $domainNamespace.'\\'], $domainPath],
],
);

if ($reload) {
$this->composerReload();
}

return $this;
}
}

0 comments on commit 1573859

Please sign in to comment.