|
| 1 | +@contentrepository @adapters=DoctrineDBAL |
| 2 | + # TODO implement for Postgres |
| 3 | +Feature: Count nodes using the countBackReferences query |
| 4 | + |
| 5 | + Background: |
| 6 | + Given I have the following content dimensions: |
| 7 | + | Identifier | Values | Generalizations | |
| 8 | + | language | mul, de, en, ch | ch->de->mul, en->mul | |
| 9 | + And I have the following NodeTypes configuration: |
| 10 | + """ |
| 11 | + 'Neos.ContentRepository:Root': [] |
| 12 | + 'Neos.ContentRepository.Testing:AbstractPage': |
| 13 | + abstract: true |
| 14 | + properties: |
| 15 | + text: |
| 16 | + type: string |
| 17 | + refs: |
| 18 | + type: references |
| 19 | + properties: |
| 20 | + foo: |
| 21 | + type: string |
| 22 | + ref: |
| 23 | + type: reference |
| 24 | + properties: |
| 25 | + foo: |
| 26 | + type: string |
| 27 | + 'Neos.ContentRepository.Testing:SomeMixin': |
| 28 | + abstract: true |
| 29 | + 'Neos.ContentRepository.Testing:Homepage': |
| 30 | + superTypes: |
| 31 | + 'Neos.ContentRepository.Testing:AbstractPage': true |
| 32 | + childNodes: |
| 33 | + terms: |
| 34 | + type: 'Neos.ContentRepository.Testing:Terms' |
| 35 | + contact: |
| 36 | + type: 'Neos.ContentRepository.Testing:Contact' |
| 37 | +
|
| 38 | + 'Neos.ContentRepository.Testing:Terms': |
| 39 | + superTypes: |
| 40 | + 'Neos.ContentRepository.Testing:AbstractPage': true |
| 41 | + properties: |
| 42 | + text: |
| 43 | + defaultValue: 'Terms default' |
| 44 | + 'Neos.ContentRepository.Testing:Contact': |
| 45 | + superTypes: |
| 46 | + 'Neos.ContentRepository.Testing:AbstractPage': true |
| 47 | + 'Neos.ContentRepository.Testing:SomeMixin': true |
| 48 | + properties: |
| 49 | + text: |
| 50 | + defaultValue: 'Contact default' |
| 51 | + 'Neos.ContentRepository.Testing:Page': |
| 52 | + superTypes: |
| 53 | + 'Neos.ContentRepository.Testing:AbstractPage': true |
| 54 | + 'Neos.ContentRepository.Testing:SpecialPage': |
| 55 | + superTypes: |
| 56 | + 'Neos.ContentRepository.Testing:AbstractPage': true |
| 57 | + """ |
| 58 | + And I am user identified by "initiating-user-identifier" |
| 59 | + And the command CreateRootWorkspace is executed with payload: |
| 60 | + | Key | Value | |
| 61 | + | workspaceName | "live" | |
| 62 | + | workspaceTitle | "Live" | |
| 63 | + | workspaceDescription | "The live workspace" | |
| 64 | + | newContentStreamId | "cs-identifier" | |
| 65 | + And the graph projection is fully up to date |
| 66 | + And I am in content stream "cs-identifier" and dimension space point {"language":"de"} |
| 67 | + And the command CreateRootNodeAggregateWithNode is executed with payload: |
| 68 | + | Key | Value | |
| 69 | + | nodeAggregateId | "lady-eleonode-rootford" | |
| 70 | + | nodeTypeName | "Neos.ContentRepository:Root" | |
| 71 | + And the graph projection is fully up to date |
| 72 | + And the following CreateNodeAggregateWithNode commands are executed: |
| 73 | + | nodeAggregateId | nodeName | nodeTypeName | parentNodeAggregateId | initialPropertyValues | tetheredDescendantNodeAggregateIds | |
| 74 | + | home | home | Neos.ContentRepository.Testing:Homepage | lady-eleonode-rootford | {} | {"terms": "terms", "contact": "contact"} | |
| 75 | + | c | c | Neos.ContentRepository.Testing:Page | home | {"text": "c"} | {} | |
| 76 | + | a | a | Neos.ContentRepository.Testing:Page | home | {"text": "a"} | {} | |
| 77 | + | a1 | a1 | Neos.ContentRepository.Testing:Page | a | {"text": "a1"} | {} | |
| 78 | + | a2 | a2 | Neos.ContentRepository.Testing:Page | a | {"text": "a2"} | {} | |
| 79 | + | a2a | a2a | Neos.ContentRepository.Testing:SpecialPage | a2 | {"text": "a2a"} | {} | |
| 80 | + | a2a1 | a2a1 | Neos.ContentRepository.Testing:Page | a2a | {"text": "a2a1"} | {} | |
| 81 | + | a2a2 | a2a2 | Neos.ContentRepository.Testing:Page | a2a | {"text": "a2a2"} | {} | |
| 82 | + | a2a3 | a2a3 | Neos.ContentRepository.Testing:Page | a2a | {"text": "a2a3"} | {} | |
| 83 | + | a3 | a3 | Neos.ContentRepository.Testing:Page | a | {"text": "a3"} | {} | |
| 84 | + | b | b | Neos.ContentRepository.Testing:Page | home | {"text": "b"} | {} | |
| 85 | + | b1 | b1 | Neos.ContentRepository.Testing:Page | b | {"text": "b1"} | {} | |
| 86 | + And the command SetNodeReferences is executed with payload: |
| 87 | + | Key | Value | |
| 88 | + | sourceNodeAggregateId | "c" | |
| 89 | + | referenceName | "refs" | |
| 90 | + | references | [{"target":"b1", "properties": {"foo": "foos"}}] | |
| 91 | + And the command SetNodeReferences is executed with payload: |
| 92 | + | Key | Value | |
| 93 | + | sourceNodeAggregateId | "a" | |
| 94 | + | referenceName | "refs" | |
| 95 | + | references | [{"target":"b1"}, {"target":"a2a2"}] | |
| 96 | + And the command SetNodeReferences is executed with payload: |
| 97 | + | Key | Value | |
| 98 | + | sourceNodeAggregateId | "b1" | |
| 99 | + | referenceName | "ref" | |
| 100 | + | references | [{"target":"a"}] | |
| 101 | + And the command SetNodeReferences is executed with payload: |
| 102 | + | Key | Value | |
| 103 | + | sourceNodeAggregateId | "b" | |
| 104 | + | referenceName | "refs" | |
| 105 | + | references | [{"target":"a3", "properties": {"foo": "bar"}}, {"target":"a2a1", "properties": {"foo": "baz"}}] | |
| 106 | + And the command SetNodeReferences is executed with payload: |
| 107 | + | Key | Value | |
| 108 | + | sourceNodeAggregateId | "a" | |
| 109 | + | referenceName | "refs" | |
| 110 | + | references | [{"target":"b1", "properties": {"foo": "bar"}}, {"target": "b"}] | |
| 111 | + And the command SetNodeReferences is executed with payload: |
| 112 | + | Key | Value | |
| 113 | + | sourceNodeAggregateId | "a2" | |
| 114 | + | referenceName | "ref" | |
| 115 | + | references | [{"target":"a2a3"}] | |
| 116 | + And the command SetNodeReferences is executed with payload: |
| 117 | + | Key | Value | |
| 118 | + | sourceNodeAggregateId | "a2a3" | |
| 119 | + | referenceName | "ref" | |
| 120 | + | references | [{"target":"a2"}] | |
| 121 | + And the command DisableNodeAggregate is executed with payload: |
| 122 | + | Key | Value | |
| 123 | + | nodeAggregateId | "a2a3" | |
| 124 | + | nodeVariantSelectionStrategy | "allVariants" | |
| 125 | + And the graph projection is fully up to date |
| 126 | + |
| 127 | + Scenario: countBackReferences queries with empty results |
| 128 | + When I execute the countBackReferences query for node aggregate id "non-existing" I expect the result 0 |
| 129 | + When I execute the countBackReferences query for node aggregate id "home" I expect the result 0 |
| 130 | + # "a2" is references node "a2a3" but "a2a3" is disabled so this reference should be ignored |
| 131 | + When I execute the countBackReferences query for node aggregate id "a2" I expect the result 0 |
| 132 | + # "a2a3" is references node "a2" but "a2a3" is disabled so this reference should be ignored |
| 133 | + When I execute the countBackReferences query for node aggregate id "a2a3" I expect the result 0 |
| 134 | + When I execute the countBackReferences query for node aggregate id "a" and filter '{"referenceName": "non-existing"}' I expect the result 0 |
| 135 | + |
| 136 | + Scenario: countBackReferences queries with results |
| 137 | + When I execute the countBackReferences query for node aggregate id "a" I expect the result 1 |
| 138 | + When I execute the countBackReferences query for node aggregate id "a3" and filter '{"referenceName": "refs"}' I expect the result 1 |
| 139 | + When I execute the countBackReferences query for node aggregate id "b1" I expect the result 2 |
0 commit comments