Skip to content

Commit

Permalink
TASK: Remove CRTestSuiteRuntimeVariables::$currentContentStreamId a…
Browse files Browse the repository at this point in the history
…nd `I am in content stream`
  • Loading branch information
mhsdesign committed Jul 2, 2024
1 parent ac6092a commit e9e4e68
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Neos.ContentRepository.Core/Classes/ContentGraphFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ trait CRTestSuiteRuntimeVariables
{
protected ?ContentRepository $currentContentRepository = null;

protected ?ContentStreamId $currentContentStreamId = null;

protected ?WorkspaceName $currentWorkspaceName = null;

protected ?DimensionSpacePoint $currentDimensionSpacePoint = null;
Expand Down Expand Up @@ -93,7 +91,6 @@ public function theCurrentDateAndTimeIs(string $timestamp): void
public function iAmInWorkspace(string $workspaceName): void
{
$this->currentWorkspaceName = WorkspaceName::fromString($workspaceName);
$this->currentContentStreamId = null;
}

/**
Expand All @@ -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)"$/
*/
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e9e4e68

Please sign in to comment.