From e9e4e682507298923c90b9d6a1f3920f2c43bad3 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:02:20 +0200 Subject: [PATCH] TASK: Remove `CRTestSuiteRuntimeVariables::$currentContentStreamId` and `I am in content stream` --- .../Classes/ContentGraphFinder.php | 2 +- .../Bootstrap/CRTestSuiteRuntimeVariables.php | 17 +---------------- .../Features/Bootstrap/CRTestSuiteTrait.php | 1 - 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/ContentGraphFinder.php b/Neos.ContentRepository.Core/Classes/ContentGraphFinder.php index 8244c2e0640..9f9cfb2f2d6 100644 --- a/Neos.ContentRepository.Core/Classes/ContentGraphFinder.php +++ b/Neos.ContentRepository.Core/Classes/ContentGraphFinder.php @@ -73,7 +73,7 @@ public function forgetInstances(): void * * @param WorkspaceName $workspaceName * @param ContentStreamId $contentStreamId - * @internal Only for testing + * @internal Only for the write side during publishing {@see \Neos\ContentRepository\Core\CommandHandlingDependencies::overrideContentStreamId} */ public function getByWorkspaceNameAndContentStreamId(WorkspaceName $workspaceName, ContentStreamId $contentStreamId): ContentGraphInterface { diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteRuntimeVariables.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteRuntimeVariables.php index e2c962de99a..4a3fa5f796a 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteRuntimeVariables.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteRuntimeVariables.php @@ -37,8 +37,6 @@ trait CRTestSuiteRuntimeVariables { protected ?ContentRepository $currentContentRepository = null; - protected ?ContentStreamId $currentContentStreamId = null; - protected ?WorkspaceName $currentWorkspaceName = null; protected ?DimensionSpacePoint $currentDimensionSpacePoint = null; @@ -93,7 +91,6 @@ public function theCurrentDateAndTimeIs(string $timestamp): void public function iAmInWorkspace(string $workspaceName): void { $this->currentWorkspaceName = WorkspaceName::fromString($workspaceName); - $this->currentContentStreamId = null; } /** @@ -114,15 +111,6 @@ public function iAmInWorkspaceAndDimensionSpacePoint(string $workspaceName, stri $this->iAmInDimensionSpacePoint($dimensionSpacePoint); } - /** - * @Given /^I am in content stream "([^"]*)" and dimension space point (.*)$/ - */ - public function iAmInContentStreamAndDimensionSpacePoint(string $contentStreamId, string $dimensionSpacePoint): void - { - $this->currentContentStreamId = ContentStreamId::fromString($contentStreamId); - $this->iAmInDimensionSpacePoint($dimensionSpacePoint); - } - /** * @When /^VisibilityConstraints are set to "(withoutRestrictions|frontend)"$/ */ @@ -138,11 +126,8 @@ public function visibilityConstraintsAreSetTo(string $restrictionType): void public function getCurrentSubgraph(): ContentSubgraphInterface { $contentGraphFinder = $this->currentContentRepository->projectionState(ContentGraphFinder::class); + // todo why do we use the ContentGraphFinder here and clear caches? Test pass without $contentGraphFinder->forgetInstances(); - if (isset($this->currentContentStreamId)) { - // This must still be supported for low level tests, e.g. for content stream forking - return $contentGraphFinder->getByWorkspaceNameAndContentStreamId($this->currentWorkspaceName, $this->currentContentStreamId)->getSubgraph($this->currentDimensionSpacePoint, $this->currentVisibilityConstraints); - } return $contentGraphFinder->getByWorkspaceName($this->currentWorkspaceName)->getSubgraph( $this->currentDimensionSpacePoint, diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php index 796e6275c1b..d9280b3b45a 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php @@ -96,7 +96,6 @@ public function beforeEventSourcedScenarioDispatcher(BeforeScenarioScope $scope) $this->currentVisibilityConstraints = VisibilityConstraints::frontend(); $this->currentDimensionSpacePoint = null; $this->currentRootNodeAggregateId = null; - $this->currentContentStreamId = null; $this->currentWorkspaceName = null; $this->currentNodeAggregate = null; $this->currentNode = null;