diff --git a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php index 4f91f39cea2..da5c068067b 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php +++ b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php @@ -24,6 +24,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\ContentStreamRemoval\Event\ContentStreamWasRemoved; use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Event\DimensionSpacePointWasMoved; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; use Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet; @@ -169,6 +170,7 @@ public function canHandle(EventInterface $event): bool NodePeerVariantWasCreated::class, NodeAggregateTypeWasChanged::class, NodeAggregateNameWasChanged::class, + ContentStreamWasRemoved::class, ]); } @@ -188,6 +190,7 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void NodePeerVariantWasCreated::class => $this->whenNodePeerVariantWasCreated($event), NodeAggregateTypeWasChanged::class => $this->whenNodeAggregateTypeWasChanged($event), NodeAggregateNameWasChanged::class => $this->whenNodeAggregateNameWasChanged($event), + ContentStreamWasRemoved::class => $this->whenContentStreamWasRemoved($event), default => throw new \InvalidArgumentException(sprintf('Unsupported event %s', get_debug_type($event))), }; } @@ -429,6 +432,11 @@ private function whenNodeAggregateNameWasChanged(NodeAggregateNameWasChanged $ev ); } + private function whenContentStreamWasRemoved(ContentStreamWasRemoved $event): void + { + $this->removeChangesForContentStreamId($event->contentStreamId); + } + private function markAsChanged( ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, @@ -562,4 +570,19 @@ private function getChangeForAggregate( return $changeRow ? Change::fromDatabaseRow($changeRow) : null; } + + private function removeChangesForContentStreamId(ContentStreamId $contentStreamId): void + { + $statement = <<tableNamePrefix} + WHERE + contentStreamId = :contentStreamId + SQL; + $this->dbal->executeStatement( + $statement, + [ + 'contentStreamId' => $contentStreamId->value, + ] + ); + } } diff --git a/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/01-DiscardWorkspace_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/01-DiscardWorkspace_WithoutDimensions.feature index 63909ce8de8..fd633631147 100644 --- a/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/01-DiscardWorkspace_WithoutDimensions.feature +++ b/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/01-DiscardWorkspace_WithoutDimensions.feature @@ -1,6 +1,6 @@ @contentrepository @adapters=DoctrineDBAL @flowEntities -Feature: Discard workspace without dimensions +Feature: Discard workspace without dimensions Background: Given using no content dimensions diff --git a/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/03-DiscardIndividualNodesFromWorkspace_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/03-DiscardIndividualNodesFromWorkspace_WithoutDimensions.feature index 059182db7bb..1f9927aeb50 100644 --- a/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/03-DiscardIndividualNodesFromWorkspace_WithoutDimensions.feature +++ b/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/03-DiscardIndividualNodesFromWorkspace_WithoutDimensions.feature @@ -1,6 +1,6 @@ @contentrepository @adapters=DoctrineDBAL @flowEntities -Feature: Publish nodes partially without dimensions +Feature: Discard nodes partially without dimensions Background: Given using no content dimensions diff --git a/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/04-DiscardIndividualNodesFromWorkspace_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/04-DiscardIndividualNodesFromWorkspace_WithDimensions.feature index e6b4bbb2628..e34fcaa0303 100644 --- a/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/04-DiscardIndividualNodesFromWorkspace_WithDimensions.feature +++ b/Neos.Neos/Tests/Behavior/Features/AssetUsage/W02-WorkspaceDiscarding/04-DiscardIndividualNodesFromWorkspace_WithDimensions.feature @@ -1,6 +1,6 @@ @contentrepository @adapters=DoctrineDBAL @flowEntities -Feature: Publish nodes partially with dimensions +Feature: Discard nodes partially with dimensions Background: Given using the following content dimensions: diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/ChangeProjectionTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/ChangeProjectionTrait.php new file mode 100644 index 00000000000..b7828cbf7a6 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/ChangeProjectionTrait.php @@ -0,0 +1,86 @@ + $className + * + * @return T + */ + abstract private function getObject(string $className): object; + + /** + * @Then I expect the ChangeProjection to have the following changes in :contentStreamId: + */ + public function iExpectTheChangeProjectionToHaveTheFollowingChangesInContentStream(TableNode $table, string $contentStreamId) + { + $changeFinder = $this->currentContentRepository->projectionState(ChangeFinder::class); + $changes = $changeFinder->findByContentStreamId(ContentStreamId::fromString($contentStreamId)); + + $tableRows = $table->getHash(); + foreach ($changes as $change) { + foreach ($tableRows as $tableRowIndex => $tableRow) { + if (!$change->nodeAggregateId->equals(NodeAggregateId::fromString($tableRow['nodeAggregateId'])) + || $change->created !== (bool)$tableRow['created'] + || $change->deleted !== (bool)$tableRow['deleted'] + || $change->changed !== (bool)$tableRow['changed'] + || $change->moved !== (bool)$tableRow['moved'] + || ( + ($change->originDimensionSpacePoint === null && strtolower($tableRow['originDimensionSpacePoint']) !== "null") + && + ($change->originDimensionSpacePoint !== null && strtolower($tableRow['originDimensionSpacePoint']) !== "null" && !$change->originDimensionSpacePoint->equals(DimensionSpacePoint::fromJsonString($tableRow['originDimensionSpacePoint']))) + ) + ) { + continue; + } + unset($tableRows[$tableRowIndex]); + continue 2; + } + } + + if (count($tableRows) !== 0) { + $tableHeader = array_combine(array_values($table->getRow(0)), array_values($table->getRow(0))); + $tableRemain = $tableRows; + array_unshift($tableRemain, $tableHeader); + + Assert::assertEmpty($tableRows, "Not all given changes where found." . PHP_EOL . (new TableNode($tableRemain))->getTableAsString()); + } + Assert::assertSame(count($table->getHash()), $changes->count(), "More changes found as given."); + } + + /** + * @Then I expect the ChangeProjection to have no changes in :contentStreamId + */ + public function iExpectTheChangeProjectionToHaveNoChangesInContentStream(string $contentStreamId) + { + $changeFinder = $this->currentContentRepository->projectionState(ChangeFinder::class); + $changes = $changeFinder->findByContentStreamId(ContentStreamId::fromString($contentStreamId)); + + Assert::assertSame(0, $changes->count(), "No changes expected."); + } +} diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php index 8ec72284b4d..77d5fba6108 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php @@ -45,6 +45,7 @@ class FeatureContext implements BehatContext use ContentCacheTrait; use AssetUsageTrait; use AssetTrait; + use ChangeProjectionTrait; use WorkspaceServiceTrait; use ContentRepositorySecurityTrait; diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/01-NodeCreation/01-CreateNodeAggregateWithNode_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/01-NodeCreation/01-CreateNodeAggregateWithNode_WithoutDimensions.feature new file mode 100644 index 00000000000..2c57a3d219a --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/01-NodeCreation/01-CreateNodeAggregateWithNode_WithoutDimensions.feature @@ -0,0 +1,64 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Create node aggregate with node without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + When the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + Scenario: Nodes on live workspace have been created + Given I am in workspace "live" + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have no changes in "cs-identifier" + + + Scenario: Nodes on user workspace have been created + Given I am in workspace "user-workspace" + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/01-NodeCreation/02-CreateNodeAggregateWithNode_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/01-NodeCreation/02-CreateNodeAggregateWithNode_WithDimensions.feature new file mode 100644 index 00000000000..e7f4adc60c8 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/01-NodeCreation/02-CreateNodeAggregateWithNode_WithDimensions.feature @@ -0,0 +1,75 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Create node aggregate with node with dimensions + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + When the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + Scenario: Nodes on live workspace have been created + Given I am in workspace "live" + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + + Then I am in dimension space point {"language": "fr"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a french text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have no changes in "cs-identifier" + + + Scenario: Nodes on user workspace have been created + Given I am in workspace "user-workspace" + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + Then I am in dimension space point {"language": "fr"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/01-CreateNodeGeneralizationVariant.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/01-CreateNodeGeneralizationVariant.feature new file mode 100644 index 00000000000..27a38f51c68 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/01-CreateNodeGeneralizationVariant.feature @@ -0,0 +1,66 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Create node generalization variant + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr,en | gsw->de->en, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + Scenario: Create node generalization variant of node with + When I am in workspace "user-workspace" and dimension space point {"language":"de"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"en"} | + + Then I expect the ChangeProjection to have no changes in "cs-identifier" + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"en"} | + + And the command PublishWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-workspace-cs-id" | + + Then I expect the ChangeProjection to have no changes in "cs-identifier" + Then I expect the ChangeProjection to have no changes in "user-cs-id" + Then I expect the ChangeProjection to have no changes in "new-user-workspace-cs-id" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/02-CreateNodeSpecializationVariant.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/02-CreateNodeSpecializationVariant.feature new file mode 100644 index 00000000000..33357264e29 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/02-CreateNodeSpecializationVariant.feature @@ -0,0 +1,58 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Create node specialization variant + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a french text about Sir Nodeward Nodington III"} | + + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + Scenario: Create node specialization variant of node + When I am in workspace "user-workspace" and dimension space point {"language":"de"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} | diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/03-CreateNodeSpecializationVariant_InternalWorkspace.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/03-CreateNodeSpecializationVariant_InternalWorkspace.feature new file mode 100644 index 00000000000..97dd8fa3e97 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/03-CreateNodeSpecializationVariant_InternalWorkspace.feature @@ -0,0 +1,81 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Create node peer variant with internal workspace between live and user workspace + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "internal-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "internal-cs-id" | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "internal-workspace" | + | newContentStreamId | "user-cs-id" | + + Scenario: Create node peer variant of node + + When I am in workspace "internal-workspace" and dimension space point {"language":"de"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + + Then I expect the ChangeProjection to have the following changes in "internal-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "user-cs-id" + + Scenario: Create node peer variant of node + + When I am in workspace "user-workspace" and dimension space point {"language":"de"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "internal-cs-id" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/04-CreateNodePeerVariant.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/04-CreateNodePeerVariant.feature new file mode 100644 index 00000000000..259ef59ab66 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/02-NodeVariation/04-CreateNodePeerVariant.feature @@ -0,0 +1,57 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Create node peer variant + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + Scenario: Create node peer variant of node + When I am in workspace "user-workspace" and dimension space point {"language":"de"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"fr"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/03-NodeModification/01-SetNodeProperties_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/03-NodeModification/01-SetNodeProperties_WithoutDimensions.feature new file mode 100644 index 00000000000..3c59b60ff11 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/03-NodeModification/01-SetNodeProperties_WithoutDimensions.feature @@ -0,0 +1,72 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Create node aggregate with node without dimensions + + Background: Create node aggregate with initial node + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + And I am in dimension space point {} + + Scenario: Set node properties without dimension and publish in user workspace + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {} | + | propertyValues | {"text": "Other text"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Remove an text from an existing property + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {} | + | propertyValues | {"text": null} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/03-NodeModification/02-SetNodeProperties_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/03-NodeModification/02-SetNodeProperties_WithDimensions.feature new file mode 100644 index 00000000000..3562f9c358e --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/03-NodeModification/02-SetNodeProperties_WithDimensions.feature @@ -0,0 +1,83 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Create node aggregate with node with dimensions + + Background: Create node aggregate with initial node + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + And I am in dimension space point {"language": "fr"} + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + And I am in dimension space point {"language": "de"} + + Scenario: Set node properties without dimension and publish in user workspace + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language":"de"} | + | propertyValues | {"text": "Other text"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + + Scenario: Remove an text from an existing property + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language":"de"} | + | propertyValues | {"text": null} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/04-NodeReferencing/01-SetNodeReferences_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/04-NodeReferencing/01-SetNodeReferences_WithoutDimensions.feature new file mode 100644 index 00000000000..f4c77344935 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/04-NodeReferencing/01-SetNodeReferences_WithoutDimensions.feature @@ -0,0 +1,71 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Node referencing without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + references: + singleReference: + constraints: + maxItems: 1 + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | references | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | [] | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | [{"referenceName": "singleReference", "references": [{"target": "sir-nodeward-nodington-iv"}]}] | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | [] | + + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + And I am in dimension space point {} + + Scenario: Set a new node reference + When the command SetNodeReferences is executed with payload: + | Key | Value | + | sourceNodeAggregateId | "sir-david-nodenborough" | + | references | [{"referenceName": "singleReference", "references": [{"target": "sir-nodeward-nodington-iv"}]}] | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Remove an existing reference from node + When the command SetNodeReferences is executed with payload: + | Key | Value | + | sourceNodeAggregateId | "nody-mc-nodeface" | + | references | [{"referenceName": "singleReference", "references": []}] | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/04-NodeReferencing/02-SetNodeReferences_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/04-NodeReferencing/02-SetNodeReferences_WithDimensions.feature new file mode 100644 index 00000000000..758bbb8771b --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/04-NodeReferencing/02-SetNodeReferences_WithDimensions.feature @@ -0,0 +1,101 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Node referencing with dimensions + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + references: + singleReference: + constraints: + maxItems: 1 + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | references | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | [] | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | [{"referenceName": "singleReference", "references": [{"target": "sir-nodeward-nodington-iv"}]}] | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | [] | + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + And I am in dimension space point {"language": "de"} + + Scenario: Set a new node reference + When the command SetNodeReferences is executed with payload: + | Key | Value | + | sourceNodeAggregateId | "sir-david-nodenborough" | + | references | [{"referenceName": "singleReference", "references": [{"target": "sir-nodeward-nodington-iv"}]}] | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language": "de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Set a new node reference in specialization + When I am in dimension space point {"language": "gsw"} + And the command SetNodeReferences is executed with payload: + | Key | Value | + | sourceNodeAggregateId | "nody-mc-nodeface" | + | references | [{"referenceName": "singleReference", "references": [{"target": "sir-nodeward-nodington-iv"}]}] | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 1 | 0 | 0 | {"language": "gsw"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Set a new node reference in generalization + When I am in dimension space point {"language": "de"} + And the command SetNodeReferences is executed with payload: + | Key | Value | + | sourceNodeAggregateId | "nody-mc-nodeface" | + | references | [{"referenceName": "singleReference", "references": [{"target": "sir-nodeward-nodington-iv"}]}] | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 1 | 0 | 0 | {"language": "de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Remove an existing reference from node + When the command SetNodeReferences is executed with payload: + | Key | Value | + | sourceNodeAggregateId | "nody-mc-nodeface" | + | references | [{"referenceName": "singleReference", "references": []}] | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 1 | 0 | 0 | {"language": "de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/05-NodeDisabling/01-DisableNode_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/05-NodeDisabling/01-DisableNode_WithoutDimensions.feature new file mode 100644 index 00000000000..e9d047e5b64 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/05-NodeDisabling/01-DisableNode_WithoutDimensions.feature @@ -0,0 +1,58 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Disable node without dimensions + + Background: Create node aggregate with initial node + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + And I am in dimension space point {} + + Scenario: Disable a node + Given the command DisableNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {} | + | nodeVariantSelectionStrategy | "allVariants" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/05-NodeDisabling/02-DisableNodes_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/05-NodeDisabling/02-DisableNodes_WithDimensions.feature new file mode 100644 index 00000000000..814e2cb4710 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/05-NodeDisabling/02-DisableNodes_WithDimensions.feature @@ -0,0 +1,98 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Disable node with dimensions + + Background: Create node aggregate with initial node + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"fr"} | + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"fr"} | + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + And I am in dimension space point {"language": "de"} + + Scenario: Disable node with all variants + Given the command DisableNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {"language":"de"} | + | nodeVariantSelectionStrategy | "allVariants" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"gsw"} | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Disable node with all specializations (de) + Given the command DisableNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {"language":"de"} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"gsw"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Disable node with all specializations (gsw) + Given the command DisableNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {"language":"gsw"} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"gsw"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/06-NodeRemoval/01-RemoveNodeAggregate_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/06-NodeRemoval/01-RemoveNodeAggregate_WithoutDimensions.feature new file mode 100644 index 00000000000..70831e0d1cb --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/06-NodeRemoval/01-RemoveNodeAggregate_WithoutDimensions.feature @@ -0,0 +1,113 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Remove node aggregate with node without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + And I am in dimension space point {} + + Scenario: Remove node aggregate in user-workspace + Given the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "nody-mc-nodeface" | + | coveredDimensionSpacePoint | {} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 0 | 0 | 1 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Remove node aggregate in live workspace + Given the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "live" | + | nodeAggregateId | "nody-mc-nodeface" | + | coveredDimensionSpacePoint | {} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "user-cs-id" + + Scenario: Remove node aggregate with children in user workspace + Given the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Remove node aggregate with children in live workspace + Given the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "live" | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "user-cs-id" + + Scenario: Remove node aggregate in user workspace which was already modified + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {} | + | propertyValues | {"text": "Other text"} | + + And the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/06-NodeRemoval/02-RemoveNodeAggregate_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/06-NodeRemoval/02-RemoveNodeAggregate_WithDimensions.feature new file mode 100644 index 00000000000..9da294c1067 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/06-NodeRemoval/02-RemoveNodeAggregate_WithDimensions.feature @@ -0,0 +1,183 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Remove node aggregate with node without dimensions + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + + Then I am in dimension space point {"language": "fr"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"fr"} | + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iv | bukara | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + | sir-nodeward-nodington-v | tinquarto | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington V"} | + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + And I am in dimension space point {"language": "de"} + + Scenario: Remove node aggregate in user-workspace + Given the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "nody-mc-nodeface" | + | coveredDimensionSpacePoint | {"language": "de"} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 0 | 0 | 1 | {"language": "de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Remove node aggregate in live workspace + Given the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "live" | + | nodeAggregateId | "nody-mc-nodeface" | + | coveredDimensionSpacePoint | {"language": "de"} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "user-cs-id" + + Scenario: Remove node aggregate with children in user workspace with "allSpecializations" + Given the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {"language": "de"} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "de"} | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "gsw"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Remove node aggregate with children in user workspace with "allVariants" + Given the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {"language": "de"} | + | nodeVariantSelectionStrategy | "allVariants" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "de"} | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "gsw"} | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Remove node aggregate with children in live workspace + Given the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "live" | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {"language": "de"} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "user-cs-id" + + Scenario: Remove node aggregate in user workspace which was already modified with "allSpecializations" + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language": "de"} | + | propertyValues | {"text": "Other text"} | + And the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language": "fr"} | + | propertyValues | {"text": "Other text"} | + + And the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {"language": "de"} | + | nodeVariantSelectionStrategy | "allSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "de"} | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "gsw"} | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language": "fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Remove node aggregate in user workspace which was already modified with "allVariants" + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language": "de"} | + | propertyValues | {"text": "Other text"} | + And the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language": "fr"} | + | propertyValues | {"text": "Other text"} | + + And the command RemoveNodeAggregate is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {"language": "de"} | + | nodeVariantSelectionStrategy | "allVariants" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "de"} | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "gsw"} | + | sir-david-nodenborough | 0 | 0 | 0 | 1 | {"language": "fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/07-NodeMove/01-MoveNodeAggregate_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/07-NodeMove/01-MoveNodeAggregate_WithoutDimensions.feature new file mode 100644 index 00000000000..8141c40ddbb --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/07-NodeMove/01-MoveNodeAggregate_WithoutDimensions.feature @@ -0,0 +1,71 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Move node aggregate without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + | lady-childton | ketchup | sir-nodeward-nodington-iv | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Lady Childton"} | + + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + And I am in dimension space point {} + + Scenario: Move nodeAggregate into new parent + When the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | newParentNodeAggregateId | "sir-nodeward-nodington-iv" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 0 | 1 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Move nodeAggregate with children into new parent + When the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-nodeward-nodington-iv" | + | newParentNodeAggregateId | "nody-mc-nodeface" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iv | 0 | 0 | 1 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/07-NodeMove/02-MoveNodeAggregate_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/07-NodeMove/02-MoveNodeAggregate_WithDimensions.feature new file mode 100644 index 00000000000..1cb69da1bfa --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/07-NodeMove/02-MoveNodeAggregate_WithDimensions.feature @@ -0,0 +1,212 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Move node aggregate with dimensions + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"fr"} | + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"fr"} | + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-nodeward-nodington-iv" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"fr"} | + + + + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + Scenario: Move nodeAggregate (variant) into new parent with scatter + When I am in dimension space point {"language": "fr"} + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-nodeward-nodington-iv" | + | newParentNodeAggregateId | "nody-mc-nodeface" | + | relationDistributionStrategy | "scatter" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iv | 0 | 0 | 1 | 0 | {"language": "fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Move nodeAggregate (generalization) into new parent with scatter + When I am in dimension space point {"language": "de"} + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | newParentNodeAggregateId | "sir-nodeward-nodington-iv" | + | relationDistributionStrategy | "scatter" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Move nodeAggregate (specialization) into new parent with scatter + When I am in dimension space point {"language": "gsw"} + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | newParentNodeAggregateId | "sir-nodeward-nodington-iv" | + | relationDistributionStrategy | "scatter" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "gsw"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + +# TODO: https://github.com/neos/neos-development-collection/issues/5368 +# Scenario: Move nodeAggregate (variant) into new parent with gatherAll +# When I am in dimension space point {"language": "fr"} +# And the command MoveNodeAggregate is executed with payload: +# | Key | Value | +# | nodeAggregateId | "nody-mc-nodeface" | +# | newParentNodeAggregateId | "sir-nodeward-nodington-iv" | +# | relationDistributionStrategy | "gatherAll" | +# +# Then I expect the ChangeProjection to have the following changes in "user-cs-id": +# | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "fr"} | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "de"} | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "gsw"} | +# And I expect the ChangeProjection to have no changes in "cs-identifier" + +# TODO: https://github.com/neos/neos-development-collection/issues/5368 +# Scenario: Move nodeAggregate (specialization) into new parent with gatherAll +# When I am in dimension space point {"language": "gsw"} +# And the command MoveNodeAggregate is executed with payload: +# | Key | Value | +# | nodeAggregateId | "nody-mc-nodeface" | +# | newParentNodeAggregateId | "sir-nodeward-nodington-iv" | +# | relationDistributionStrategy | "gatherAll" | +# +# Then I expect the ChangeProjection to have the following changes in "user-cs-id": +# | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "de"} | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "fr"} | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "gsw"} | +# And I expect the ChangeProjection to have no changes in "cs-identifier" + +# TODO: https://github.com/neos/neos-development-collection/issues/5368 +# Scenario: Move nodeAggregate (generalization) into new parent with gatherAll +# When I am in dimension space point {"language": "de"} +# And the command MoveNodeAggregate is executed with payload: +# | Key | Value | +# | nodeAggregateId | "nody-mc-nodeface" | +# | newParentNodeAggregateId | "sir-nodeward-nodington-iv" | +# | relationDistributionStrategy | "gatherAll" | +# +# Then I expect the ChangeProjection to have the following changes in "user-cs-id": +# | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "de"} | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "fr"} | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "gsw"} | +# And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Move nodeAggregate (variant) into new parent with gatherSpecializations + When I am in dimension space point {"language": "fr"} + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | newParentNodeAggregateId | "sir-nodeward-nodington-iv" | + | relationDistributionStrategy | "gatherSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Move nodeAggregate (specialization) into new parent with gatherSpecializations + When I am in dimension space point {"language": "gsw"} + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | newParentNodeAggregateId | "sir-nodeward-nodington-iv" | + | relationDistributionStrategy | "gatherSpecializations" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "gsw"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + +# TODO: https://github.com/neos/neos-development-collection/issues/5368 +# Scenario: Move nodeAggregate (generalization) into new parent with gatherSpecializations +# When I am in dimension space point {"language": "de"} +# And the command MoveNodeAggregate is executed with payload: +# | Key | Value | +# | nodeAggregateId | "nody-mc-nodeface" | +# | newParentNodeAggregateId | "sir-nodeward-nodington-iv" | +# | relationDistributionStrategy | "gatherSpecializations" | +# +# Then I expect the ChangeProjection to have the following changes in "user-cs-id": +# | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "de"} | +# | nody-mc-nodeface | 0 | 0 | 1 | 0 | {"language": "gsw"} | +# And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Move nodeAggregate with children into new parent + When I am in dimension space point {"language": "de"} + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-nodeward-nodington-iv" | + | newParentNodeAggregateId | "nody-mc-nodeface" | + | relationDistributionStrategy | "scatter" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iv | 0 | 0 | 1 | 0 | {"language": "de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/08-NodeRenaming/01-ChangeNodeAggregateName_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/08-NodeRenaming/01-ChangeNodeAggregateName_WithoutDimensions.feature new file mode 100644 index 00000000000..4082df00bd5 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/08-NodeRenaming/01-ChangeNodeAggregateName_WithoutDimensions.feature @@ -0,0 +1,79 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Change node aggregate name without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + 'Neos.ContentRepository.Testing:NewNode': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + And I am in dimension space point {} + + Scenario: Change the node aggregate name of a node with children + Given the command ChangeNodeAggregateName is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | newNodeName | "renamed-document" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | null | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Change the node aggregate name with already applied changes + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {} | + | propertyValues | {"text": "Other text"} | + + Then the command ChangeNodeAggregateName is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | newNodeName | "renamed-document" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | null | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/08-NodeRenaming/02-ChangeNodeAggregateName_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/08-NodeRenaming/02-ChangeNodeAggregateName_WithDimensions.feature new file mode 100644 index 00000000000..06897a88ee1 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/08-NodeRenaming/02-ChangeNodeAggregateName_WithDimensions.feature @@ -0,0 +1,92 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Change node aggregate name with dimensions + + Background: Create node aggregate with initial node + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + 'Neos.ContentRepository.Testing:NewNode': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + And I am in dimension space point {"language": "fr"} + + Then the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language": "de"} | + | targetOrigin | {"language": "fr"} | + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + And I am in dimension space point {"language": "de"} + + Scenario: Change the node aggregate type of a node with children + Given the command ChangeNodeAggregateName is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | newNodeName | "renamed-document" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | null | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Change the node aggregate type with already applied changes + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language": "de"} | + | propertyValues | {"text": "Other text"} | + + Then the command ChangeNodeAggregateName is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | newNodeName | "renamed-document" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | null | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/09-NodeTypeChange/01-ChangeNodeAggregateType_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/09-NodeTypeChange/01-ChangeNodeAggregateType_WithoutDimensions.feature new file mode 100644 index 00000000000..ee0793e9ca9 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/09-NodeTypeChange/01-ChangeNodeAggregateType_WithoutDimensions.feature @@ -0,0 +1,83 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Change node aggregate type without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + 'Neos.ContentRepository.Testing:NewNode': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + And I am in dimension space point {} + + Scenario: Change the node aggregate type of a node with children + Given the command ChangeNodeAggregateType is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | newNodeTypeName | "Neos.ContentRepository.Testing:NewNode" | + | strategy | "happypath" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | null | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Change the node aggregate type with already applied changes + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {} | + | propertyValues | {"text": "Other text"} | + + Then the command ChangeNodeAggregateType is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | newNodeTypeName | "Neos.ContentRepository.Testing:NewNode" | + | strategy | "happypath" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | null | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/09-NodeTypeChange/02-ChangeNodeAggregateType_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/09-NodeTypeChange/02-ChangeNodeAggregateType_WithDimensions.feature new file mode 100644 index 00000000000..fa37c9700ca --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/09-NodeTypeChange/02-ChangeNodeAggregateType_WithDimensions.feature @@ -0,0 +1,96 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Change node aggregate type with dimensions + + Background: Create node aggregate with initial node + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr | gsw->de, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + 'Neos.ContentRepository.Testing:NewNode': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + And I am in dimension space point {"language": "fr"} + + Then the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language": "de"} | + | targetOrigin | {"language": "fr"} | + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + And I am in dimension space point {"language": "de"} + + Scenario: Change the node aggregate type of a node with children + Given the command ChangeNodeAggregateType is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | newNodeTypeName | "Neos.ContentRepository.Testing:NewNode" | + | strategy | "happypath" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | null | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Change the node aggregate type with already applied changes + Given the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language": "de"} | + | propertyValues | {"text": "Other text"} | + + Then the command ChangeNodeAggregateType is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | newNodeTypeName | "Neos.ContentRepository.Testing:NewNode" | + | strategy | "happypath" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | null | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/10-DimensionSpaceAdjustment/01-MoveDimensionSpacePoints.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/10-DimensionSpaceAdjustment/01-MoveDimensionSpacePoints.feature new file mode 100644 index 00000000000..f17d0250d7d --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/10-DimensionSpaceAdjustment/01-MoveDimensionSpacePoints.feature @@ -0,0 +1,185 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Move DimensionSpacePoints + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr,en | gsw->de->en, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then I am in dimension space point {"language": "fr"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + | sir-nodeward-nodington-v | quatilde | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington V"} | + + Then the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + Then the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language": "de"} | + | propertyValues | {"text": "Some text"} | + Then the command SetNodeProperties is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodeAggregateId | "sir-nodeward-nodington-iv" | + | originDimensionSpacePoint | {"language": "fr"} | + | propertyValues | {"text": "Some french text"} | + + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 0 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + And I am in workspace "live" + + Scenario: Rename a dimension value in live workspace + Given I change the content dimensions in content repository "default" to: + | Identifier | Values | Generalizations | + | language | de_DE,gsw,fr,en | gsw->de_DE->en, fr | + + And I run the following node migration for workspace "live", creating target workspace "migration" on contentStreamId "migration-cs-id", with publishing on success: + """yaml + migration: + - + transformations: + - + type: 'MoveDimensionSpacePoint' + settings: + from: {"language":"de"} + to: {"language":"de_DE"} + """ + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 0 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "migration-cs-id" + + + Scenario: Rename a dimension value in user workspace + Given I change the content dimensions in content repository "default" to: + | Identifier | Values | Generalizations | + | language | de_DE,gsw,fr,en | gsw->de_DE->en, fr | + + And I run the following node migration for workspace "user-workspace", creating target workspace "migration" on contentStreamId "migration-cs-id", with publishing on success: + """yaml + migration: + - + transformations: + - + type: 'MoveDimensionSpacePoint' + settings: + from: {"language":"de"} + to: {"language":"de_DE"} + """ + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de_DE"} | + | sir-nodeward-nodington-iv | 0 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "migration-cs-id" + + + Scenario: Adding a dimension in live workspace + Given I change the content dimensions in content repository "default" to: + | Identifier | Values | Generalizations | + | language | de,gsw,fr,en | gsw->de->en, fr | + | market | DE, FR | DE, FR | + + And I run the following node migration for workspace "live", creating target workspace "migration-cs" on contentStreamId "migration-cs", with publishing on success: + """yaml + migration: + - + transformations: + - + type: 'MoveDimensionSpacePoint' + settings: + from: {"language":"de"} + to: {"language":"de", "market": "DE"} + - + type: 'MoveDimensionSpacePoint' + settings: + from: {"language":"fr"} + to: {"language":"fr", "market": "FR"} + """ + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 0 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "migration-cs-id" + + + Scenario: Adding a dimension in user workspace + Given I change the content dimensions in content repository "default" to: + | Identifier | Values | Generalizations | + | language | de,gsw,fr,en | gsw->de->en, fr | + | market | DE, FR | DE, FR | + + And I run the following node migration for workspace "user-workspace", creating target workspace "migration-cs" on contentStreamId "migration-cs", with publishing on success: + """yaml + migration: + - + transformations: + - + type: 'MoveDimensionSpacePoint' + settings: + from: {"language":"de"} + to: {"language":"de", "market": "DE"} + - + type: 'MoveDimensionSpacePoint' + settings: + from: {"language":"fr"} + to: {"language":"fr", "market": "FR"} + """ + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de", "market": "DE"} | + | sir-nodeward-nodington-iv | 0 | 1 | 0 | 0 | {"language":"fr", "market": "FR"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + And I expect the ChangeProjection to have no changes in "migration-cs-id" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/01-PublishWorkspace_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/01-PublishWorkspace_WithoutDimensions.feature new file mode 100644 index 00000000000..73e7c6661d6 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/01-PublishWorkspace_WithoutDimensions.feature @@ -0,0 +1,109 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Publish nodes without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Scenario: Publish nodes from user workspace to live + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + + And the command PublishWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "new-user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + + Scenario: Publish nodes from user workspace to a non live workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "review-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "review-cs-id" | + + And I am in workspace "review-workspace" + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "review-workspace" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + And I am in dimension space point {} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + + And the command PublishWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "new-user-cs-id" + And I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/02-PublishWorkspace_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/02-PublishWorkspace_WithDimensions.feature new file mode 100644 index 00000000000..6cd0e203077 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/02-PublishWorkspace_WithDimensions.feature @@ -0,0 +1,176 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Publish nodes with dimensions + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr,en | gsw->de->en, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Scenario: Publish nodes from user workspace to live + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + Then I am in dimension space point {"language": "fr"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + + And the command PublishWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "new-user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Publish nodes from user workspace to a non live workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "review-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "review-cs-id" | + + And I am in workspace "review-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "review-workspace" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + Then I am in dimension space point {"language": "gsw"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + And the command SetNodeProperties is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | originDimensionSpacePoint | {"language":"gsw"} | + | propertyValues | {"text": "Some other text"} | + + And I am in dimension space point {"language": "fr"} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + + And the command PublishWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "new-user-cs-id" + And I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Publish nodes from user workspace to live with new generalization + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"en"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"en"} | + + And the command PublishWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + Then I expect the ChangeProjection to have no changes in "new-user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/03-PublishIndividualNodesFromWorkspace_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/03-PublishIndividualNodesFromWorkspace_WithoutDimensions.feature new file mode 100644 index 00000000000..98e67598008 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/03-PublishIndividualNodesFromWorkspace_WithoutDimensions.feature @@ -0,0 +1,113 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Publish nodes partially without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Scenario: Publish nodes partially from user workspace to live + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + + When the command PublishIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | nodesToPublish | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-david-nodenborough"}] | + | contentStreamIdForRemainingPart | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Publish nodes partially from user workspace to a non live workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "review-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "review-cs-id" | + + When I am in workspace "review-workspace" + + And I am in dimension space point {} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "review-workspace" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + And I am in dimension space point {} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + + When the command PublishIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | nodesToPublish | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "nody-mc-nodeface"}] | + | contentStreamIdForRemainingPart | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/04-PublishIndividualNodesFromWorkspace_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/04-PublishIndividualNodesFromWorkspace_WithDimensions.feature new file mode 100644 index 00000000000..a0227c2e0ad --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W01-WorkspacePublication/04-PublishIndividualNodesFromWorkspace_WithDimensions.feature @@ -0,0 +1,185 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Publish nodes partially with dimensions + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr,en | gsw->de->en, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Scenario: Publish nodes partially from user workspace to live + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + + Then I am in dimension space point {"language": "fr"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + + When the command PublishIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | nodesToPublish | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {"language": "de"}, "nodeAggregateId": "sir-david-nodenborough"}] | + | contentStreamIdForRemainingPart | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Publish nodes partially from user workspace to a non live workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "review-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "review-cs-id" | + + And I am in workspace "review-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "review-workspace" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + Then I am in dimension space point {"language": "gsw"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + And the command SetNodeProperties is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | originDimensionSpacePoint | {"language":"gsw"} | + | propertyValues | {"text": "Other text"} | + + And I am in dimension space point {"language": "fr"} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + + When the command PublishIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | nodesToPublish | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {"language": "de"}, "nodeAggregateId": "nody-mc-nodeface"}] | + | contentStreamIdForRemainingPart | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Publish nodes partially from user workspace to live with new generalization + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"en"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"en"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"de"} | + + When the command PublishIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | nodesToPublish | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {"language": "de"}, "nodeAggregateId": "sir-david-nodenborough"},{"workspaceName": "user-workspace", "dimensionSpacePoint": {"language": "en"}, "nodeAggregateId": "sir-david-nodenborough"}] | + | contentStreamIdForRemainingPart | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"de"} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/01-DiscardWorkspace_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/01-DiscardWorkspace_WithoutDimensions.feature new file mode 100644 index 00000000000..f6e58c8d3a3 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/01-DiscardWorkspace_WithoutDimensions.feature @@ -0,0 +1,109 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Discard workspace without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + + + Scenario: Discard changes in user workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + + When the command DiscardWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "new-user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + + Scenario: Discard changes in user workspace with a non-live base workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "review-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "review-cs-id" | + + And I am in workspace "review-workspace" + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "review-workspace" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + And I am in dimension space point {} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + + Then I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + + When the command DiscardWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + And I expect the ChangeProjection to have no changes in "new-user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/02-DiscardWorkspace_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/02-DiscardWorkspace_WithDimensions.feature new file mode 100644 index 00000000000..c059beaa9c4 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/02-DiscardWorkspace_WithDimensions.feature @@ -0,0 +1,196 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Discard workspace with dimensions + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr,en | gsw->de->en, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + + Scenario: Discard user workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + Then I am in dimension space point {"language": "fr"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + + When the command DiscardWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "new-user-cs-id" + + + Scenario: Discard user workspace with a non-live base workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "review-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "review-cs-id" | + + And I am in workspace "review-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "review-workspace" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + Then I am in dimension space point {"language": "gsw"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + + And the command SetNodeProperties is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | originDimensionSpacePoint | {"language":"gsw"} | + | propertyValues | {"text": "Some other text"} | + + And I am in dimension space point {"language": "fr"} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + Then I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + + When the command DiscardWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "new-user-cs-id" + And I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + + Scenario: Discard user workspace with new generalization + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"en"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"en"} | + + When the command DiscardWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "new-user-cs-id" + + Scenario: Discard user workspace after change to an existing asseet usage of a property + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + + And the command SetNodeProperties is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | originDimensionSpacePoint | {"language":"de"} | + | propertyValues | {"text": "New text"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language":"de"} | + + When the command DiscardWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | newContentStreamId | "new-user-cs-id" | + + Then I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "new-user-cs-id" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/03-DiscardIndividualNodesFromWorkspace_WithoutDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/03-DiscardIndividualNodesFromWorkspace_WithoutDimensions.feature new file mode 100644 index 00000000000..1f47143ce90 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/03-DiscardIndividualNodesFromWorkspace_WithoutDimensions.feature @@ -0,0 +1,195 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Discard nodes partially without dimensions + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + + Scenario: Discards nodes partially from user workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + + When the command DiscardIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodesToDiscard | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"}] | + | newContentStreamId | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Discards multiple nodes partially from user workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {} | + + When the command DiscardIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodesToDiscard | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"},{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iv"}] | + | newContentStreamId | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Discards nodes partially from user workspace with a non-live base workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "review-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "review-cs-id" | + + And I am in workspace "review-workspace" + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "review-workspace" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + And I am in dimension space point {} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + | sir-nodeward-nodington-iv | bukara | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + + When the command DiscardIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodesToDiscard | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iv"}] | + | newContentStreamId | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Discards multiple nodes partially from user workspace with a non-live base workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "review-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "review-cs-id" | + + And I am in workspace "review-workspace" + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "review-workspace" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + And I am in dimension space point {} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + | sir-nodeward-nodington-iv | bukara | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + | sir-nodeward-nodington-v | tinquarto | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington V"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {} | + | sir-nodeward-nodington-v | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + + When the command DiscardIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodesToDiscard | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iv"},{"workspaceName": "user-workspace", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-v"}] | + | newContentStreamId | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" diff --git a/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/04-DiscardIndividualNodesFromWorkspace_WithDimensions.feature b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/04-DiscardIndividualNodesFromWorkspace_WithDimensions.feature new file mode 100644 index 00000000000..522aaf2028c --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/PendingChanges/W02-WorkspaceDiscarding/04-DiscardIndividualNodesFromWorkspace_WithDimensions.feature @@ -0,0 +1,188 @@ +@contentrepository @adapters=DoctrineDBAL +@flowEntities +Feature: Discard nodes partially with dimensions + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de,gsw,fr,en | gsw->de->en, fr | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Node': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + + And I am in workspace "live" + And I am in dimension space point {"language": "de"} + And I am user identified by "initiating-user-identifier" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + + Scenario: Discards nodes partially from user workspace with live base workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + + Then I am in dimension space point {"language": "fr"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington III"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"fr"} | + + When the command DiscardIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodesToDiscard | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {"language": "de"}, "nodeAggregateId": "sir-david-nodenborough"}, {"workspaceName": "user-workspace", "dimensionSpacePoint": {"language": "de"}, "nodeAggregateId": "nody-mc-nodeface"}] | + | newContentStreamId | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Discards nodes partially from user workspace with non live base workspace + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "review-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "review-cs-id" | + + And I am in workspace "review-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + + And the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "review-workspace" | + | newContentStreamId | "user-cs-id" | + + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + + Then I am in dimension space point {"language": "gsw"} + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"gsw"} | + And the command SetNodeProperties is executed with payload: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | originDimensionSpacePoint | {"language":"gsw"} | + | propertyValues | {"text": "Other text"} | + + And I am in dimension space point {"language": "fr"} + Then the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington IV"} | + + Then I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"gsw"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"fr"} | + + When the command DiscardIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodesToDiscard | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {"language": "gsw"}, "nodeAggregateId": "nody-mc-nodeface"}] | + | newContentStreamId | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "review-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + And I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"fr"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"fr"} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier" + + Scenario: Discard nodes partially from user workspace with live base workspace with new generalization + Given the command CreateWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | baseWorkspaceName | "live" | + | newContentStreamId | "user-cs-id" | + And I am in workspace "user-workspace" + + Then I am in dimension space point {"language": "de"} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | parentNodeAggregateId | nodeTypeName | initialPropertyValues | + | sir-david-nodenborough | node | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {} | + | nody-mc-nodeface | child-node | sir-david-nodenborough | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Nody Mc Nodeface"} | + | sir-nodeward-nodington-iii | esquire | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a extended text about Sir Nodeward Nodington III"} | + | sir-nodeward-nodington-iv | bakura | lady-eleonode-rootford | Neos.ContentRepository.Testing:Node | {"text": "This is a text about Sir Nodeward Nodington IV"} | + + And the command CreateNodeVariant is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | sourceOrigin | {"language":"de"} | + | targetOrigin | {"language":"en"} | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"en"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iii | 1 | 1 | 0 | 0 | {"language":"de"} | + + When the command DiscardIndividualNodesFromWorkspace is executed with payload: + | Key | Value | + | workspaceName | "user-workspace" | + | nodesToDiscard | [{"workspaceName": "user-workspace", "dimensionSpacePoint": {"language": "en"} , "nodeAggregateId": "sir-david-nodenborough"}, {"workspaceName": "user-workspace", "dimensionSpacePoint": {"language": "de"} , "nodeAggregateId": "sir-nodeward-nodington-iii"}] | + | newContentStreamId | "user-cs-id-remaining" | + + Then I expect the ChangeProjection to have the following changes in "user-cs-id-remaining": + | nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint | + | sir-david-nodenborough | 1 | 1 | 0 | 0 | {"language":"de"} | + | nody-mc-nodeface | 1 | 1 | 0 | 0 | {"language":"de"} | + | sir-nodeward-nodington-iv | 1 | 1 | 0 | 0 | {"language":"de"} | + And I expect the ChangeProjection to have no changes in "user-cs-id" + And I expect the ChangeProjection to have no changes in "cs-identifier"