diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature index e3dd0b80089..6a53e48ea3e 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature @@ -56,15 +56,16 @@ Feature: On forking a content stream, hidden nodes should be correctly copied as | nodeVariantSelectionStrategy | "allVariants" | Scenario: on ForkContentStream, the disabled nodes in the target content stream should still be invisible. - When the command ForkContentStream is executed with payload: - | Key | Value | - | sourceContentStreamId | "cs-identifier" | - | contentStreamId | "user-cs-identifier" | - + # Uses ForkContentStream implicitly + When the command CreateWorkspace is executed with payload: + | Key | Value | + | baseWorkspaceName | "live" | + | workspaceName | "user-test" | + | newContentStreamId | "user-cs-identifier" | # node aggregate occupation and coverage is not relevant without dimensions and thus not tested - When I am in content stream "user-cs-identifier" and dimension space point {} + When I am in workspace "user-test" and dimension space point {} And VisibilityConstraints are set to "withoutRestrictions" Then I expect node aggregate identifier "lady-eleonode-rootford" to lead to node user-cs-identifier;lady-eleonode-rootford;{} And I expect this node to have the following child nodes: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature index ab8748cb07d..61e7aa232f0 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature @@ -50,19 +50,24 @@ Feature: ForkContentStream Without Dimensions | propertiesToUnset | {} | Scenario: Ensure that the node is available in the forked content stream - When the command "ForkContentStream" is executed with payload: - | Key | Value | - | contentStreamId | "user-cs-identifier" | - | sourceContentStreamId | "cs-identifier" | - And I am in content stream "user-cs-identifier" and dimension space point {} + # Uses ForkContentStream implicitly + When the command CreateWorkspace is executed with payload: + | Key | Value | + | baseWorkspaceName | "live" | + | workspaceName | "user-test" | + | newContentStreamId | "user-cs-identifier" | + When I am in workspace "user-test" and dimension space point {} Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node user-cs-identifier;nody-mc-nodeface;{} Scenario: When a change is applied to the forked content stream AFTER the fork, it is not visible in the live content stream. - When the command "ForkContentStream" is executed with payload: - | Key | Value | - | contentStreamId | "user-cs-identifier" | - | sourceContentStreamId | "cs-identifier" | + # Uses ForkContentStream implicitly + When the command CreateWorkspace is executed with payload: + | Key | Value | + | baseWorkspaceName | "live" | + | workspaceName | "user-test" | + | newContentStreamId | "user-cs-identifier" | + And the event NodePropertiesWereSet was published with payload: | Key | Value | | workspaceName | "user" | @@ -73,15 +78,15 @@ Feature: ForkContentStream Without Dimensions | propertyValues | {"text": {"value": "modified value", "type": "string"}} | | propertiesToUnset | {} | - # live - When I am in content stream "cs-identifier" and dimension space point {} + # live + When I am in workspace "live" and dimension space point {} Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node cs-identifier;nody-mc-nodeface;{} And I expect this node to have the following properties: | Key | Value | | text | "original value" | # forked content stream - When I am in content stream "user-cs-identifier" and dimension space point {} + When I am in workspace "user-test" and dimension space point {} Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node user-cs-identifier;nody-mc-nodeface;{} And I expect this node to have the following properties: | Key | Value | @@ -89,10 +94,12 @@ Feature: ForkContentStream Without Dimensions # this is a "reverse" scenario of the scenario above. Scenario: When a change is applied on the live content stream AFTER the fork, it is NOT visible in the forked content stream. - When the command "ForkContentStream" is executed with payload: - | Key | Value | - | contentStreamId | "user-cs-identifier" | - | sourceContentStreamId | "cs-identifier" | + # Uses ForkContentStream implicitly + When the command CreateWorkspace is executed with payload: + | Key | Value | + | baseWorkspaceName | "live" | + | workspaceName | "user-test" | + | newContentStreamId | "user-cs-identifier" | And the event NodePropertiesWereSet was published with payload: | Key | Value | | workspaceName | "live" | @@ -104,14 +111,14 @@ Feature: ForkContentStream Without Dimensions | propertiesToUnset | {} | # live - When I am in content stream "cs-identifier" and dimension space point {} + When I am in workspace "live" and dimension space point {} Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node cs-identifier;nody-mc-nodeface;{} And I expect this node to have the following properties: | Key | Value | | text | "modified value" | # forked content stream - When I am in content stream "user-cs-identifier" and dimension space point {} + When I am in workspace "user-test" and dimension space point {} Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node user-cs-identifier;nody-mc-nodeface;{} And I expect this node to have the following properties: | Key | Value | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/NodeReferencesOnForkContentStream.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/NodeReferencesOnForkContentStream.feature index 9df23e60042..e21dd731eb3 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/NodeReferencesOnForkContentStream.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/NodeReferencesOnForkContentStream.feature @@ -45,13 +45,15 @@ Feature: On forking a content stream, node references should be copied as well. | referenceName | "referenceProperty" | | references | [{"target": "anthony-destinode"}] | - When the command ForkContentStream is executed with payload: - | Key | Value | - | contentStreamId | "user-cs-identifier" | - | sourceContentStreamId | "cs-identifier" | + # Uses ForkContentStream implicitly + When the command CreateWorkspace is executed with payload: + | Key | Value | + | baseWorkspaceName | "live" | + | workspaceName | "user-test" | + | newContentStreamId | "user-cs-identifier" | # after forking, the reference must still exist on the forked content stream (no surprises here). - When I am in content stream "user-cs-identifier" and dimension space point {"language": "de"} + When I am in workspace "user-test" and dimension space point {"language": "de"} Then I expect node aggregate identifier "source-nodandaise" to lead to node user-cs-identifier;source-nodandaise;{"language": "de"} Then I expect this node to have the following references: | Name | Node | Properties | @@ -61,7 +63,7 @@ Feature: On forking a content stream, node references should be copied as well. | Name | Node | Properties | | referenceProperty | user-cs-identifier;source-nodandaise;{"language": "de"} | null | - When I am in content stream "user-cs-identifier" and dimension space point {"language": "ch"} + When I am in workspace "user-test" and dimension space point {"language": "ch"} Then I expect node aggregate identifier "source-nodandaise" to lead to node user-cs-identifier;source-nodandaise;{"language": "de"} Then I expect this node to have the following references: | Name | Node | Properties | @@ -73,7 +75,7 @@ Feature: On forking a content stream, node references should be copied as well. # after then modifying the node's properties (thus triggering copy-on-write), the reference property # should still exist (this was a BUG) - When I am in content stream "user-cs-identifier" and dimension space point {"language": "de"} + When I am in workspace "user-test" and dimension space point {"language": "de"} And the command SetNodeProperties is executed with payload: | Key | Value | | nodeAggregateId | "source-nodandaise" | @@ -87,7 +89,7 @@ Feature: On forking a content stream, node references should be copied as well. | Name | Node | Properties | | referenceProperty | user-cs-identifier;source-nodandaise;{"language": "de"} | null | - When I am in content stream "user-cs-identifier" and dimension space point {"language": "ch"} + When I am in workspace "user-test" and dimension space point {"language": "ch"} Then I expect node aggregate identifier "source-nodandaise" to lead to node user-cs-identifier;source-nodandaise;{"language": "de"} And I expect this node to have the following references: | Name | Node | Properties | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature index 90bf3b31b01..d16d22d5069 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature @@ -67,7 +67,7 @@ Feature: Move dimension space point to: { language: 'de_DE' } """ # the original content stream has not been touched - When I am in content stream "cs-identifier" and dimension space point {"language": "de"} + When I am in workspace "live" and dimension space point {"language": "de"} Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:Document" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/04-AllFeaturePublication.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/04-AllFeaturePublication.feature index 4ab6fc9c584..cefedf691f0 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/04-AllFeaturePublication.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/04-AllFeaturePublication.feature @@ -38,7 +38,7 @@ Feature: Publishing hide/show scenario of nodes | Key | Value | | workspaceName | "live" | | newContentStreamId | "cs-identifier" | - And I am in workspace "live" + And I am in workspace "live" and dimension space point {} And the command CreateRootNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "lady-eleonode-rootford" | @@ -104,13 +104,16 @@ Feature: Publishing hide/show scenario of nodes | contentStreamIdForRemainingPart | "remaining-cs-id" | | contentStreamIdForMatchingPart | "matching-cs-id" | - When I am in workspace "live" and dimension space point {} + When I am in workspace "live" Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node And I expect node aggregate identifier "nody-mc-nodeface" to lead to no node And I expect node aggregate identifier "sir-nodeward-nodington-iii" to lead to node cs-identifier;sir-nodeward-nodington-iii;{} - When I am in content stream "remaining-cs-id" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node + When I am in workspace "user-test" + # Ensure that we are in content stream remaining-cs-id + Then I expect node aggregate identifier "lady-eleonode-rootford" to lead to node remaining-cs-id;lady-eleonode-rootford;{} + + And I expect node aggregate identifier "sir-david-nodenborough" to lead to no node And I expect node aggregate identifier "nody-mc-nodeface" to lead to no node And I expect node aggregate identifier "sir-nodeward-nodington-iii" to lead to no node diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/PruneContentStreams.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/PruneContentStreams.feature index d97c1c7ec15..4cedde28f3c 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/PruneContentStreams.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/PruneContentStreams.feature @@ -53,6 +53,10 @@ Feature: If content streams are not in use anymore by the workspace, they can be | workspaceName | "user-test" | | baseWorkspaceName | "live" | | newContentStreamId | "user-cs-identifier" | + When I am in workspace "user-test" and dimension space point {} + # Ensure that we are in content user-cs-identifier + Then I expect node aggregate identifier "root-node" to lead to node user-cs-identifier;root-node;{} + When the command RebaseWorkspace is executed with payload: | Key | Value | | workspaceName | "user-test" | @@ -60,9 +64,7 @@ Feature: If content streams are not in use anymore by the workspace, they can be # now, we have one unused content stream (the old content stream of the user-test workspace) When I prune unused content streams - - When I am in content stream "user-cs-identifier" and dimension space point {} - Then I expect node aggregate identifier "root-node" to lead to no node + Then I expect the content stream "user-cs-identifier" to not exist When I am in workspace "user-test" and dimension space point {} Then I expect node aggregate identifier "root-node" to lead to node user-cs-identifier-rebased;root-node;{} 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.Core/Classes/Feature/ContentStreamClosing/Command/CloseContentStream.php b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Command/CloseContentStream.php index f0143c9d3fe..16dfd711342 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Command/CloseContentStream.php +++ b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Command/CloseContentStream.php @@ -18,7 +18,9 @@ use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; /** - * @api commands are the write-API of the ContentRepository + * @internal implementation detail. You must not use this command directly. + * Direct use may lead to hard to revert senseless state in your content repository. + * Please use the higher level workspace commands instead. */ final readonly class CloseContentStream implements CommandInterface { diff --git a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Command/ReopenContentStream.php b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Command/ReopenContentStream.php index 7f7fab54218..41436f34d75 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Command/ReopenContentStream.php +++ b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Command/ReopenContentStream.php @@ -19,7 +19,9 @@ use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamState; /** - * @api commands are the write-API of the ContentRepository + * @internal implementation detail. You must not use this command directly. + * Direct use may lead to hard to revert senseless state in your content repository. + * Please use the higher level workspace commands instead. */ final readonly class ReopenContentStream implements CommandInterface { diff --git a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCreation/Command/CreateContentStream.php b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCreation/Command/CreateContentStream.php index e3ef05736df..8644048817e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCreation/Command/CreateContentStream.php +++ b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCreation/Command/CreateContentStream.php @@ -21,7 +21,9 @@ * CreateContentStream for creating the FIRST content stream. * All other content streams will be FORKED from this FIRST content stream. * - * @api commands are the write-API of the ContentRepository + * @internal implementation detail. You must not use this command directly. + * Direct use may lead to hard to revert senseless state in your content repository. + * Please use the higher level workspace commands instead. */ final readonly class CreateContentStream implements CommandInterface { diff --git a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamForking/Command/ForkContentStream.php b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamForking/Command/ForkContentStream.php index d049c6a01d3..5ca25937112 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamForking/Command/ForkContentStream.php +++ b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamForking/Command/ForkContentStream.php @@ -20,7 +20,9 @@ /** * ForkContentStream for creating a new fork of a content stream. * - * @api commands are the write-API of the ContentRepository + * @internal implementation detail. You must not use this command directly. + * Direct use may lead to hard to revert senseless state in your content repository. + * Please use the higher level workspace commands instead. */ final readonly class ForkContentStream implements CommandInterface { diff --git a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamRemoval/Command/RemoveContentStream.php b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamRemoval/Command/RemoveContentStream.php index 45b2512c34e..f79c0fe1da8 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamRemoval/Command/RemoveContentStream.php +++ b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamRemoval/Command/RemoveContentStream.php @@ -20,7 +20,9 @@ /** * Command to remove an existing content stream * - * @api commands are the write-API of the ContentRepository + * @internal implementation detail. You must not use this command directly. + * Direct use may lead to hard to revert senseless state in your content repository. + * Please use the higher level workspace commands instead. */ final readonly class RemoveContentStream implements CommandInterface { diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteRuntimeVariables.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteRuntimeVariables.php index f5c2204d01d..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; @@ -87,21 +85,12 @@ public function theCurrentDateAndTimeIs(string $timestamp): void FakeClock::setNow(\DateTimeImmutable::createFromFormat(\DateTimeInterface::ATOM, $timestamp)); } - /** - * @Given /^I am in content stream "([^"]*)"$/ - */ - public function iAmInContentStream(string $contentStreamId): void - { - $this->currentContentStreamId = ContentStreamId::fromString($contentStreamId); - } - /** * @Given /^I am in workspace "([^"]*)"$/ */ public function iAmInWorkspace(string $workspaceName): void { $this->currentWorkspaceName = WorkspaceName::fromString($workspaceName); - $this->currentContentStreamId = null; } /** @@ -122,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->iAmInContentStream($contentStreamId); - $this->iAmInDimensionSpacePoint($dimensionSpacePoint); - } - /** * @When /^VisibilityConstraints are set to "(withoutRestrictions|frontend)"$/ */ @@ -146,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 057edaa23b6..d9280b3b45a 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php @@ -25,7 +25,6 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\NodeTypeCriteria; use Neos\ContentRepository\Core\Projection\ContentGraph\Subtree; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; -use Neos\ContentRepository\Core\Projection\Workspace\Workspace; use Neos\ContentRepository\Core\Service\ContentStreamPruner; use Neos\ContentRepository\Core\Service\ContentStreamPrunerFactory; use Neos\ContentRepository\Core\SharedModel\Exception\RootNodeAggregateDoesNotExist; @@ -97,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; @@ -132,31 +130,14 @@ protected function readPayloadTable(TableNode $payloadTable): array } /** - * @Then /^workspace "([^"]*)" points to another content stream than workspace "([^"]*)"$/ + * @Then /^I expect the content stream "([^"]*)" to not exist$/ */ - public function workspacesPointToDifferentContentStreams(string $rawWorkspaceNameA, string $rawWorkspaceNameB): void + public function iExpectTheContentStreamToNotExist(string $rawContentStreamId): void { - $workspaceA = $this->currentContentRepository->getWorkspaceFinder()->findOneByName(WorkspaceName::fromString($rawWorkspaceNameA)); - Assert::assertInstanceOf(Workspace::class, $workspaceA, 'Workspace "' . $rawWorkspaceNameA . '" does not exist.'); - $workspaceB = $this->currentContentRepository->getWorkspaceFinder()->findOneByName(WorkspaceName::fromString($rawWorkspaceNameB)); - Assert::assertInstanceOf(Workspace::class, $workspaceB, 'Workspace "' . $rawWorkspaceNameB . '" does not exist.'); - if ($workspaceA && $workspaceB) { - Assert::assertNotEquals( - $workspaceA->currentContentStreamId->value, - $workspaceB->currentContentStreamId->value, - 'Workspace "' . $rawWorkspaceNameA . '" points to the same content stream as "' . $rawWorkspaceNameB . '"' - ); - } - } - - /** - * @Then /^workspace "([^"]*)" does not point to content stream "([^"]*)"$/ - */ - public function workspaceDoesNotPointToContentStream(string $rawWorkspaceName, string $rawContentStreamId): void - { - $workspace = $this->currentContentRepository->getWorkspaceFinder()->findOneByName(WorkspaceName::fromString($rawWorkspaceName)); - - Assert::assertNotEquals($rawContentStreamId, $workspace->currentContentStreamId->value); + Assert::assertTrue( + $this->currentContentRepository->getContentStreamFinder()->hasContentStream(ContentStreamId::fromString($rawContentStreamId)), + sprintf('The content stream "%s" does exist.', $rawContentStreamId) + ); } /** diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Helpers/NodeDiscriminator.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Helpers/NodeDiscriminator.php index 005e5464e4d..f2b7563a97e 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Helpers/NodeDiscriminator.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Helpers/NodeDiscriminator.php @@ -14,6 +14,7 @@ namespace Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Helpers; +use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -47,10 +48,11 @@ public static function fromShorthand(string $shorthand): self ); } - public static function fromNode(Node $node): self + public static function fromNode(Node $node, ContentRepository $contentRepository): self { + $contentStreamOfNode = $contentRepository->getContentGraph($node->workspaceName)->getContentStreamId(); return new self( - $node->subgraphIdentity->contentStreamId, + $contentStreamOfNode, $node->aggregateId, $node->originDimensionSpacePoint ); diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Helpers/NodeDiscriminators.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Helpers/NodeDiscriminators.php index 2bedcbce70e..07924d1de4a 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Helpers/NodeDiscriminators.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Helpers/NodeDiscriminators.php @@ -53,14 +53,6 @@ public static function fromArray(array $array): self )); } - public static function fromNodes(Nodes $nodes): self - { - return new self(...array_map( - fn (Node $node): NodeDiscriminator => NodeDiscriminator::fromNode($node), - iterator_to_array($nodes) - )); - } - public function equal(self $other): bool { return $this->discriminators == $other->discriminators; diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php index b227c5660b6..f89d3015040 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php @@ -110,7 +110,7 @@ public function iExpectNodeAggregateIdToLeadToNode( $this->initializeCurrentNodeFromContentSubgraph(function (ContentSubgraphInterface $subgraph) use ($nodeAggregateId, $expectedDiscriminator) { $currentNode = $subgraph->findNodeById($nodeAggregateId); Assert::assertNotNull($currentNode, 'No node could be found by node aggregate id "' . $nodeAggregateId->value . '" in content subgraph "' . $this->currentDimensionSpacePoint->toJson() . '@' . $this->currentWorkspaceName->value . '"'); - $actualDiscriminator = NodeDiscriminator::fromNode($currentNode); + $actualDiscriminator = NodeDiscriminator::fromNode($currentNode, $this->currentContentRepository); Assert::assertTrue($expectedDiscriminator->equals($actualDiscriminator), 'Node discriminators do not match. Expected was ' . json_encode($expectedDiscriminator) . ' , given was ' . json_encode($actualDiscriminator)); return $currentNode; }); @@ -147,7 +147,7 @@ public function iExpectPathToLeadToNode(string $serializedNodePath, string $seri $this->initializeCurrentNodeFromContentSubgraph(function (ContentSubgraphInterface $subgraph) use ($nodePath, $expectedDiscriminator) { $currentNode = $subgraph->findNodeByPath($nodePath, $this->getRootNodeAggregateId()); Assert::assertNotNull($currentNode, 'No node could be found by node path "' . $nodePath->serializeToString() . '" in content subgraph "' . $this->currentDimensionSpacePoint->toJson() . '@' . $this->currentWorkspaceName->value . '"'); - $actualDiscriminator = NodeDiscriminator::fromNode($currentNode); + $actualDiscriminator = NodeDiscriminator::fromNode($currentNode, $this->currentContentRepository); Assert::assertTrue($expectedDiscriminator->equals($actualDiscriminator), 'Node discriminators do not match. Expected was ' . json_encode($expectedDiscriminator) . ' , given was ' . json_encode($actualDiscriminator)); return $currentNode; }); @@ -479,7 +479,7 @@ private function assertReferencesMatch(TableNode $expectedReferencesTable, Refer $actualReferences[$index]->name->value ); $expectedReferenceDiscriminator = NodeDiscriminator::fromShorthand($row['Node']); - $actualReferenceDiscriminator = NodeDiscriminator::fromNode($actualReferences[$index]->node); + $actualReferenceDiscriminator = NodeDiscriminator::fromNode($actualReferences[$index]->node, $this->currentContentRepository); Assert::assertTrue( $expectedReferenceDiscriminator->equals($actualReferenceDiscriminator), 'Reference discriminator does not match.' @@ -553,12 +553,12 @@ public function iExpectThisNodeToBeTheChildOfNode(string $serializedParentNodeDi $parent = $subgraph->findParentNode($currentNode->aggregateId); Assert::assertInstanceOf(Node::class, $parent, 'Parent not found.'); - $actualParentDiscriminator = NodeDiscriminator::fromNode($parent); + $actualParentDiscriminator = NodeDiscriminator::fromNode($parent, $this->currentContentRepository); Assert::assertTrue($expectedParentDiscriminator->equals($actualParentDiscriminator), 'Parent discriminator does not match. Expected was ' . json_encode($expectedParentDiscriminator) . ', given was ' . json_encode($actualParentDiscriminator)); - $expectedChildDiscriminator = NodeDiscriminator::fromNode($currentNode); + $expectedChildDiscriminator = NodeDiscriminator::fromNode($currentNode, $this->currentContentRepository); $child = $subgraph->findNodeByPath($currentNode->name, $parent->aggregateId); - $actualChildDiscriminator = NodeDiscriminator::fromNode($child); + $actualChildDiscriminator = NodeDiscriminator::fromNode($child, $this->currentContentRepository); Assert::assertTrue($expectedChildDiscriminator->equals($actualChildDiscriminator), 'Child discriminator does not match. Expected was ' . json_encode($expectedChildDiscriminator) . ', given was ' . json_encode($actualChildDiscriminator)); }); } @@ -596,7 +596,10 @@ public function iExpectThisNodeToHaveTheFollowingChildNodes(TableNode $expectedC Assert::assertTrue($expectedNodeName->equals($actualNodeName), 'ContentSubgraph::findChildNodes: Node name in index ' . $index . ' does not match. Expected: "' . $expectedNodeName->value . '" Actual: "' . $actualNodeName->value . '"'); if (isset($row['NodeDiscriminator'])) { $expectedNodeDiscriminator = NodeDiscriminator::fromShorthand($row['NodeDiscriminator']); - $actualNodeDiscriminator = NodeDiscriminator::fromNode($actualChildNodes[$index]); + $actualNodeDiscriminator = NodeDiscriminator::fromNode( + $actualChildNodes[$index], + $this->currentContentRepository + ); Assert::assertTrue($expectedNodeDiscriminator->equals($actualNodeDiscriminator), 'ContentSubgraph::findChildNodes: Node discriminator in index ' . $index . ' does not match. Expected: ' . json_encode($expectedNodeDiscriminator->jsonSerialize()) . ' Actual: ' . json_encode($actualNodeDiscriminator)); } } @@ -635,7 +638,10 @@ public function iExpectThisNodeToHaveTheFollowingPrecedingSiblings(TableNode $ex Assert::assertCount(count($expectedPrecedingSiblingsTable->getHash()), $actualSiblings, 'ContentSubgraph::findPrecedingSiblingNodes: Sibling count does not match'); foreach ($expectedPrecedingSiblingsTable->getHash() as $index => $row) { $expectedNodeDiscriminator = NodeDiscriminator::fromShorthand($row['NodeDiscriminator']); - $actualNodeDiscriminator = NodeDiscriminator::fromNode($actualSiblings[$index]); + $actualNodeDiscriminator = NodeDiscriminator::fromNode( + $actualSiblings[$index], + $this->currentContentRepository + ); Assert::assertTrue($expectedNodeDiscriminator->equals($actualNodeDiscriminator), 'ContentSubgraph::findPrecedingSiblingNodes: Node discriminator in index ' . $index . ' does not match. Expected: ' . json_encode($expectedNodeDiscriminator) . ' Actual: ' . json_encode($actualNodeDiscriminator)); } }); @@ -672,7 +678,10 @@ public function iExpectThisNodeToHaveTheFollowingSucceedingSiblings(TableNode $e Assert::assertCount(count($expectedSucceedingSiblingsTable->getHash()), $actualSiblings, 'ContentSubgraph::findSucceedingSiblingNodes: Sibling count does not match'); foreach ($expectedSucceedingSiblingsTable->getHash() as $index => $row) { $expectedNodeDiscriminator = NodeDiscriminator::fromShorthand($row['NodeDiscriminator']); - $actualNodeDiscriminator = NodeDiscriminator::fromNode($actualSiblings[$index]); + $actualNodeDiscriminator = NodeDiscriminator::fromNode( + $actualSiblings[$index], + $this->currentContentRepository + ); Assert::assertTrue($expectedNodeDiscriminator->equals($actualNodeDiscriminator), 'ContentSubgraph::findSucceedingSiblingNodes: Node discriminator in index ' . $index . ' does not match. Expected: ' . json_encode($expectedNodeDiscriminator) . ' Actual: ' . json_encode($actualNodeDiscriminator)); } }); diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature index 4aee9e82b50..a9266914f39 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature @@ -35,7 +35,6 @@ Feature: Tests for the "Neos.Neos:ConvertUris" Fusion prototype | Key | Value | | nodeAggregateId | "root" | | nodeTypeName | "Neos.Neos:Sites" | - And I am in content stream "cs-identifier" and dimension space point {} And the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | parentNodeAggregateId | nodeTypeName | initialPropertyValues | nodeName | | a | root | Neos.Neos:Site | {"title": "Node a"} | a | diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature index 6e1c2effe20..bd76b9e096c 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/FlowQuery.feature @@ -46,12 +46,11 @@ Feature: Tests for the "Neos.ContentRepository" Flow Query methods. | Key | Value | | workspaceName | "live" | | newContentStreamId | "cs-identifier" | - And I am in workspace "live" + And I am in workspace "live" and dimension space point {} And the command CreateRootNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "root" | | nodeTypeName | "Neos.Neos:Sites" | - And I am in content stream "cs-identifier" and dimension space point {} And the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | parentNodeAggregateId | nodeTypeName | initialPropertyValues | nodeName | | a | root | Neos.Neos:Site | {"title": "Node a"} | a |