Skip to content

Commit

Permalink
TASK: Ensure pure dbal repositories are pruned
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Dec 10, 2024
1 parent cf5b34e commit 447c4dc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Neos.Neos/Tests/Behavior/Features/Bootstrap/AssetUsageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
*/
Expand Down Expand Up @@ -75,4 +85,4 @@ public function iRunTheAssetUsageIndexingProcessor(string $rootNodeTypeName)
NodeTypeName::fromString($rootNodeTypeName),
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 447c4dc

Please sign in to comment.