Skip to content

Commit

Permalink
Merge pull request #4708 from neos/workspaceAwareCommands
Browse files Browse the repository at this point in the history
!!! TASK: Workspace aware commands
  • Loading branch information
nezaniel authored Mar 14, 2024
2 parents 76d3351 + 82494f1 commit fe5c14b
Show file tree
Hide file tree
Showing 252 changed files with 3,902 additions and 2,423 deletions.
8 changes: 7 additions & 1 deletion .composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"../../bin/phpunit --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/UnitTests.xml Neos.ContentRepository.Core/Tests/Unit",
"../../bin/phpunit --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/UnitTests.xml Neos.ContentRepositoryRegistry/Tests/Unit"
],
"test:parallel": [
"FLOW_CONTEXT=Testing/Behat ../../bin/paratest --debug -v --functional --group parallel --processes 2 --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml Neos.ContentRepository.BehavioralTests/Tests/Functional/Feature/WorkspacePublication/WorkspaceWritingDuringPublication.php",
"FLOW_CONTEXT=Testing/Behat ../../bin/paratest --debug -v --functional --group parallel --processes 2 --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml Neos.ContentRepository.BehavioralTests/Tests/Functional/Feature/WorkspacePublication/WorkspaceWritingDuringPublication.php",
"FLOW_CONTEXT=Testing/Behat ../../bin/paratest --debug -v --functional --group parallel --processes 2 --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml Neos.ContentRepository.BehavioralTests/Tests/Functional/Feature/WorkspacePublication/WorkspaceWritingDuringPublication.php"
],
"test:functional": [
"../../bin/phpunit --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml Neos.ContentRepository.Core/Tests/Functional"
],
Expand All @@ -54,7 +59,8 @@
"test": [
"@test:unit",
"@test:functional",
"@test:behavioral"
"@test:behavioral",
"@test:parallel"
]
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Feature: Run integrity violation detection regarding hierarchy relations and nod
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in the active content stream of workspace "live" and dimension space point {}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Feature: Run integrity violation detection regarding parent relations
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in the active content stream of workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Feature: Run integrity violation detection regarding reference relations
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in the active content stream of workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
Expand All @@ -51,7 +51,6 @@ Feature: Run integrity violation detection regarding reference relations
Scenario: Detach a reference relation from its source
When the command SetNodeReferences is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| sourceOriginDimensionSpacePoint | {"language":"de"} |
| sourceNodeAggregateId | "source-nodandaise" |
| referenceName | "referenceProperty" |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Feature: Run integrity violation detection regarding restriction relations
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in the active content stream of workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Feature: Run integrity violation detection regarding restriction relations
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in the active content stream of workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the graph projection is fully up to date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Feature: Run integrity violation detection regarding sibling sorting
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in the active content stream of workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the graph projection is fully up to date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Feature: Run projection integrity violation detection regarding naming of tether
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in the active content stream of workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Feature: Create a root node aggregate
'Neos.ContentRepository.Testing:AbstractRoot':
abstract: true
'Neos.ContentRepository.Testing:NonRoot': []
'Neos.ContentRepository.Testing:OtherRoot':
superTypes:
'Neos.ContentRepository:Root': true
"""
And using identifier "default", I define a content repository
And I am in content repository "default"
Expand All @@ -24,21 +27,31 @@ Feature: Create a root node aggregate
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in content stream "cs-identifier"
And I am in the active content stream of workspace "live"
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the graph projection is fully up to date

Scenario: Try to create a root node aggregate in a content stream that currently does not exist:
Scenario: Try to create a root node aggregate in a workspace that currently does not exist:
When the command CreateRootNodeAggregateWithNode is executed with payload and exceptions are caught:
| Key | Value |
| contentStreamId | "i-do-not-exist" |
| workspaceName | "i-do-not-exist" |
| nodeAggregateId | "nody-mc-nodeface" |
| nodeTypeName | "Neos.ContentRepository:Root" |
Then the last command should have thrown an exception of type "ContentStreamDoesNotExistYet"

Scenario: Try to create a root node aggregate in a closed content stream:
When the command CloseContentStream is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
And the command CreateRootNodeAggregateWithNode is executed with payload and exceptions are caught:
| Key | Value |
| nodeAggregateId | "nody-mc-nodeface" |
| nodeTypeName | "Neos.ContentRepository.Testing:OtherRoot" |
Then the last command should have thrown an exception of type "ContentStreamIsClosed"

Scenario: Try to create a root node aggregate in a content stream where it is already present:
When the command CreateRootNodeAggregateWithNode is executed with payload and exceptions are caught:
| Key | Value |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Create a root node aggregate
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in content stream "cs-identifier"
And I am in the active content stream of workspace "live"

Scenario: Create the initial root node aggregate using valid payload without dimensions
When the command CreateRootNodeAggregateWithNode is executed with payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ Feature: Create a root node aggregate with tethered children
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in content stream "cs-identifier"
And I am in dimension space point {}
And I am in the active content stream of workspace "live" and dimension space point {}
And I am user identified by "initiating-user-identifier"

Scenario: Create root node with tethered children
Expand Down Expand Up @@ -134,7 +133,7 @@ Feature: Create a root node aggregate with tethered children
| Key | Value |
| text | "my sub sub default" |

When I am in content stream "cs-identifier" and dimension space point []
And I am in the active content stream of workspace "live" and dimension space point {}
And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
And I expect this node to have no parent node
And I expect this node to have the following child nodes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Feature: Create a root node aggregate with tethered children
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in content stream "cs-identifier"
And I am in the active content stream of workspace "live"
And I am user identified by "initiating-user-identifier"

Scenario: Create root node with tethered children
Expand Down Expand Up @@ -173,7 +173,7 @@ Feature: Create a root node aggregate with tethered children
| Key | Value |
| text | "my sub sub default" |

When I am in content stream "cs-identifier" and dimension space point {"language": "de"}
When I am in the active content stream of workspace "live" and dimension space point {"language": "de"}
And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
And I expect this node to have no parent node
And I expect this node to have the following child nodes:
Expand Down Expand Up @@ -202,7 +202,7 @@ Feature: Create a root node aggregate with tethered children
And I expect this node to have no references
And I expect this node to not be referenced

When I am in content stream "cs-identifier" and dimension space point {"language": "gsw"}
When I am in the active content stream of workspace "live" and dimension space point {"language": "gsw"}
And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
And I expect this node to have no parent node
And I expect this node to have the following child nodes:
Expand Down Expand Up @@ -232,7 +232,7 @@ Feature: Create a root node aggregate with tethered children
And I expect this node to not be referenced


When I am in content stream "cs-identifier" and dimension space point {"language": "en"}
When I am in the active content stream of workspace "live" and dimension space point {"language": "en"}
And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
And I expect this node to have no parent node
And I expect this node to have the following child nodes:
Expand Down Expand Up @@ -262,7 +262,7 @@ Feature: Create a root node aggregate with tethered children
And I expect this node to not be referenced


When I am in content stream "cs-identifier" and dimension space point {"language": "en_US"}
When I am in the active content stream of workspace "live" and dimension space point {"language": "en_US"}
And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
And I expect this node to have no parent node
And I expect this node to have the following child nodes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: Create a root node aggregate
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in content stream "cs-identifier"
And I am in the active content stream of workspace "live"

Scenario: Create the initial root node aggregate using valid payload with dimensions
When the command CreateRootNodeAggregateWithNode is executed with payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,38 @@ Feature: Create node aggregate with node
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in content stream "cs-identifier"
And I am in dimension space point {}
And I am in the active content stream of workspace "live" and dimension space point {}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the graph projection is fully up to date

Scenario: Try to create a node aggregate in a content stream that currently does not exist:
Scenario: Try to create a node aggregate in a workspace that currently does not exist:
When the command CreateNodeAggregateWithNode is executed with payload and exceptions are caught:
| Key | Value |
| contentStreamId | "non-existent-cs-identifier" |
| workspaceName | "non-existent" |
| nodeAggregateId | "sir-david-nodenborough" |
| nodeTypeName | "Neos.ContentRepository.Testing:Node" |
| parentNodeAggregateId | "lady-eleonode-rootford" |
| nodeName | "document" |

Then the last command should have thrown an exception of type "ContentStreamDoesNotExistYet"

Scenario: Try to create a node aggregate in a content stream where it is already present:
Scenario: Try to create a node aggregate in a workspace whose content stream is closed:
When the command CloseContentStream is executed with payload:
| Key | Value |
| contentStreamId | "cs-identifier" |
And the command CreateNodeAggregateWithNode is executed with payload and exceptions are caught:
| Key | Value |
| nodeAggregateId | "sir-david-nodenborough" |
| nodeTypeName | "Neos.ContentRepository.Testing:Node" |
| parentNodeAggregateId | "lady-eleonode-rootford" |
| nodeName | "document" |

Then the last command should have thrown an exception of type "ContentStreamIsClosed"

Scenario: Try to create a node aggregate in a workspace where it is already present:
When the command CreateNodeAggregateWithNode is executed with payload and exceptions are caught:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Feature: Create node aggregate with node
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in content stream "cs-identifier"
And I am in the active content stream of workspace "live"
And I am in dimension space point {}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
Expand Down
Loading

0 comments on commit fe5c14b

Please sign in to comment.