|
| 1 | +@contentrepository @adapters=DoctrineDBAL |
| 2 | +Feature: Change property type from scalar to backed enum |
| 3 | + |
| 4 | + Background: |
| 5 | + Given using the following content dimensions: |
| 6 | + | Identifier | Values | Generalizations | |
| 7 | + | example | general, source, peer, spec | spec->source->general, peer->general | |
| 8 | + And using the following node types: |
| 9 | + """yaml |
| 10 | + 'Neos.ContentRepository:Root': |
| 11 | + constraints: |
| 12 | + nodeTypes: |
| 13 | + 'Neos.ContentRepository.Testing:Document': true |
| 14 | + 'Neos.ContentRepository.Testing:OtherDocument': true |
| 15 | + 'Neos.ContentRepository.Testing:Document': |
| 16 | + properties: |
| 17 | + myString: |
| 18 | + type: string |
| 19 | + myInt: |
| 20 | + type: int |
| 21 | + """ |
| 22 | + And using identifier "default", I define a content repository |
| 23 | + And I am in content repository "default" |
| 24 | + And the command CreateRootWorkspace is executed with payload: |
| 25 | + | Key | Value | |
| 26 | + | workspaceName | "live" | |
| 27 | + | newContentStreamId | "cs-identifier" | |
| 28 | + And I am in workspace "live" |
| 29 | + And the command CreateRootNodeAggregateWithNode is executed with payload: |
| 30 | + | Key | Value | |
| 31 | + | nodeAggregateId | "lady-eleonode-rootford" | |
| 32 | + | nodeTypeName | "Neos.ContentRepository:Root" | |
| 33 | + When the command CreateNodeAggregateWithNode is executed with payload: |
| 34 | + | Key | Value | |
| 35 | + | nodeAggregateId | "nody-mc-nodeface" | |
| 36 | + | nodeTypeName | "Neos.ContentRepository.Testing:Document" | |
| 37 | + | originDimensionSpacePoint | {"example": "general"} | |
| 38 | + | parentNodeAggregateId | "lady-eleonode-rootford" | |
| 39 | + | initialPropertyValues | {"myString": "https://schema.org/Wednesday", "myInt": 42} | |
| 40 | + When the command CreateNodeVariant is executed with payload: |
| 41 | + | Key | Value | |
| 42 | + | nodeAggregateId | "nody-mc-nodeface" | |
| 43 | + | sourceOrigin | {"example":"general"} | |
| 44 | + | targetOrigin | {"example":"source"} | |
| 45 | + When the command CreateNodeVariant is executed with payload: |
| 46 | + | Key | Value | |
| 47 | + | nodeAggregateId | "nody-mc-nodeface" | |
| 48 | + | sourceOrigin | {"example":"general"} | |
| 49 | + | targetOrigin | {"example":"peer"} | |
| 50 | + |
| 51 | + |
| 52 | + Scenario: Change property type from scalar to backed enum creating a new target workspace |
| 53 | + When I change the node types in content repository "default" to: |
| 54 | + """yaml |
| 55 | + 'Neos.ContentRepository:Root': |
| 56 | + constraints: |
| 57 | + nodeTypes: |
| 58 | + 'Neos.ContentRepository.Testing:Document': true |
| 59 | + 'Neos.ContentRepository.Testing:OtherDocument': true |
| 60 | + 'Neos.ContentRepository.Testing:Document': |
| 61 | + properties: |
| 62 | + myString: |
| 63 | + type: \Neos\ContentRepository\Core\Tests\Behavior\Fixtures\DayOfWeek |
| 64 | + myInt: |
| 65 | + type: \Neos\ContentRepository\Core\Tests\Behavior\Fixtures\ArbitraryNumber |
| 66 | + """ |
| 67 | + And I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: |
| 68 | + """yaml |
| 69 | + migration: |
| 70 | + - |
| 71 | + filters: |
| 72 | + - |
| 73 | + type: 'NodeType' |
| 74 | + settings: |
| 75 | + nodeType: 'Neos.ContentRepository.Testing:Document' |
| 76 | + transformations: |
| 77 | + - |
| 78 | + type: 'ChangePropertyTypeFromScalarToBackedEnum' |
| 79 | + settings: |
| 80 | + property: 'myString' |
| 81 | + - |
| 82 | + type: 'ChangePropertyTypeFromScalarToBackedEnum' |
| 83 | + settings: |
| 84 | + property: 'myInt' |
| 85 | + """ |
| 86 | + |
| 87 | + # the original content stream has not been touched |
| 88 | + When I am in workspace "live" and dimension space point {"example": "general"} |
| 89 | + Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node cs-identifier;nody-mc-nodeface;{"example": "general"} |
| 90 | + And I expect this node to have the following properties: |
| 91 | + | Key | Value | |
| 92 | + | myString | https://schema.org/Wednesday | |
| 93 | + | myInt | 42 | |
| 94 | + |
| 95 | + When I am in workspace "live" and dimension space point {"example": "source"} |
| 96 | + Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node cs-identifier;nody-mc-nodeface;{"example": "source"} |
| 97 | + And I expect this node to have the following properties: |
| 98 | + | Key | Value | |
| 99 | + | myString | https://schema.org/Wednesday | |
| 100 | + | myInt | 42 | |
| 101 | + |
| 102 | + When I am in workspace "live" and dimension space point {"example": "peer"} |
| 103 | + Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node cs-identifier;nody-mc-nodeface;{"example": "peer"} |
| 104 | + And I expect this node to have the following properties: |
| 105 | + | Key | Value | |
| 106 | + | myString | https://schema.org/Wednesday | |
| 107 | + | myInt | 42 | |
| 108 | + |
| 109 | + When I am in workspace "live" and dimension space point {"example": "spec"} |
| 110 | + Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node cs-identifier;nody-mc-nodeface;{"example": "source"} |
| 111 | + And I expect this node to have the following properties: |
| 112 | + | Key | Value | |
| 113 | + | myString | https://schema.org/Wednesday | |
| 114 | + | myInt | 42 | |
| 115 | + |
| 116 | + # the node was changed in the new content stream, in all variants |
| 117 | + When I am in workspace "migration-workspace" and dimension space point {"example": "general"} |
| 118 | + Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node migration-cs;nody-mc-nodeface;{"example": "general"} |
| 119 | + And I expect this node to have the following properties: |
| 120 | + | Key | Value | |
| 121 | + | myString | DayOfWeek:https://schema.org/Wednesday | |
| 122 | + | myInt | ArbitraryNumber:42 | |
| 123 | + |
| 124 | + When I am in workspace "migration-workspace" and dimension space point {"example": "source"} |
| 125 | + Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node migration-cs;nody-mc-nodeface;{"example": "source"} |
| 126 | + And I expect this node to have the following properties: |
| 127 | + | Key | Value | |
| 128 | + | myString | DayOfWeek:https://schema.org/Wednesday | |
| 129 | + | myInt | ArbitraryNumber:42 | |
| 130 | + |
| 131 | + When I am in workspace "migration-workspace" and dimension space point {"example": "peer"} |
| 132 | + Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node migration-cs;nody-mc-nodeface;{"example": "peer"} |
| 133 | + And I expect this node to have the following properties: |
| 134 | + | Key | Value | |
| 135 | + | myString | DayOfWeek:https://schema.org/Wednesday | |
| 136 | + | myInt | ArbitraryNumber:42 | |
| 137 | + |
| 138 | + When I am in workspace "migration-workspace" and dimension space point {"example": "spec"} |
| 139 | + Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node migration-cs;nody-mc-nodeface;{"example": "source"} |
| 140 | + And I expect this node to have the following properties: |
| 141 | + | Key | Value | |
| 142 | + | myString | DayOfWeek:https://schema.org/Wednesday | |
| 143 | + | myInt | ArbitraryNumber:42 | |
0 commit comments