diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/AssetUsageTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/AssetUsageTrait.php index 53d5e61c49..12671d99f9 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/AssetUsageTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/AssetUsageTrait.php @@ -36,6 +36,16 @@ trait AssetUsageTrait */ abstract private function getObject(string $className): object; + /** + * @BeforeScenario + */ + final public function pruneAssetUsage(): void + { + foreach (static::$alreadySetUpContentRepositories as $contentRepositoryId) { + $this->getObject(\Neos\Neos\AssetUsage\Domain\AssetUsageRepository::class)->removeAll($contentRepositoryId); + } + } + /** * @Then I expect the AssetUsageService to have the following AssetUsages: */ @@ -75,4 +85,4 @@ public function iRunTheAssetUsageIndexingProcessor(string $rootNodeTypeName) NodeTypeName::fromString($rootNodeTypeName), ); } -} \ No newline at end of file +} diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/WorkspaceServiceTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/WorkspaceServiceTrait.php index af046a3944..faeb26c533 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/WorkspaceServiceTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/WorkspaceServiceTrait.php @@ -48,6 +48,17 @@ trait WorkspaceServiceTrait */ abstract private function getObject(string $className): object; + /** + * @BeforeScenario + */ + final public function pruneWorkspaceService(): void + { + foreach (static::$alreadySetUpContentRepositories as $contentRepositoryId) { + $this->getObject(\Neos\Neos\Domain\Repository\WorkspaceMetadataAndRoleRepository::class)->pruneWorkspaceMetadata($contentRepositoryId); + $this->getObject(\Neos\Neos\Domain\Repository\WorkspaceMetadataAndRoleRepository::class)->pruneRoleAssignments($contentRepositoryId); + } + } + /** * @When the root workspace :workspaceName is created * @When the root workspace :workspaceName with title :title and description :description is created