Skip to content

Commit 35e6af9

Browse files
committed
Reinstated multivalue tests
1 parent b499396 commit 35e6af9

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

fixtures/10_Writing/mixinreferenceable.xml

+27
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,32 @@
102102
<sv:value>nt:unstructured</sv:value>
103103
</sv:property>
104104
</sv:node>
105+
106+
<sv:node sv:name="testSetUuidNewReferenceable">
107+
<sv:property sv:name="jcr:primaryType" sv:type="Name">
108+
<sv:value>nt:unstructured</sv:value>
109+
</sv:property>
110+
</sv:node>
111+
112+
<sv:node sv:name="testSetUuidNewButNonreferenceable">
113+
<sv:property sv:name="jcr:primaryType" sv:type="Name">
114+
<sv:value>nt:unstructured</sv:value>
115+
</sv:property>
116+
</sv:node>
117+
118+
<sv:node sv:name="testSetUuidButNotReferenceableExisting">
119+
<sv:property sv:name="jcr:primaryType" sv:type="Name">
120+
<sv:value>nt:unstructured</sv:value>
121+
</sv:property>
122+
</sv:node>
123+
124+
<sv:node sv:name="testSetUuidReferenceableButExisting">
125+
<sv:property sv:name="jcr:primaryType" sv:type="Name">
126+
<sv:value>nt:unstructured</sv:value>
127+
</sv:property>
128+
<sv:property sv:name="jcr:mixinTypes" sv:type="Name">
129+
<sv:value>mix:referenceable</sv:value>
130+
</sv:property>
131+
</sv:node>
105132
</sv:node>
106133

tests/10_Writing/MixinReferenceableTest.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,15 @@ private function doTestMultiValueReference($nodeNames, $nodeCollectionNames, $re
159159
public function testSetUuidNewReferenceable()
160160
{
161161
$uuid = 'aaaa61c0-09ab-42a9-87c0-308ccc93aaaa';
162-
$node = $this->session->getNode('/tests_general_base/index.txt/jcr:content')->addNode('newId', 'nt:unstructured');
162+
$node = $this->node->addNode('newId', 'nt:unstructured');
163163
$node->addMixin('mix:referenceable');
164164
$node->setProperty('jcr:uuid', $uuid);
165165
$this->session->save();
166166
$this->assertSame($uuid, $node->getIdentifier());
167167

168168
$session = $this->renewSession();
169169

170-
$node = $session->getNode('/tests_general_base/index.txt/jcr:content/newId');
170+
$node = $this->node->getNode('newId');
171171
$this->assertSame($uuid, $node->getIdentifier());
172172
}
173173

@@ -176,7 +176,7 @@ public function testSetUuidNewReferenceable()
176176
*/
177177
public function testSetUuidNewButNonreferenceable()
178178
{
179-
$node = $this->session->getNode('/tests_general_base/index.txt/jcr:content')->addNode('newNonref', 'nt:unstructured');
179+
$node = $this->node->addNode('newNonref', 'nt:unstructured');
180180
$node->setProperty('jcr:uuid', 'bbbb61c0-09ab-42a9-87c0-308ccc93aaaa');
181181
}
182182

@@ -185,16 +185,14 @@ public function testSetUuidNewButNonreferenceable()
185185
*/
186186
public function testSetUuidReferenceableButExisting()
187187
{
188-
$node = $this->session->getNode('/tests_general_base/idExample');
189-
$node->setProperty('jcr:uuid', 'cccc61c0-09ab-42a9-87c0-308ccc93aaaa');
188+
$this->node->setProperty('jcr:uuid', 'cccc61c0-09ab-42a9-87c0-308ccc93aaaa');
190189
}
191190

192191
/**
193192
* @expectedException \PHPCR\NodeType\ConstraintViolationException
194193
*/
195194
public function testSetUuidButNotReferenceableExisting()
196195
{
197-
$node = $this->session->getNode('/tests_general_base/index.txt/jcr:content');
198-
$node->setProperty('jcr:uuid', 'dddd61c0-09ab-42a9-87c0-308ccc93aaaa');
196+
$this->node->setProperty('jcr:uuid', 'dddd61c0-09ab-42a9-87c0-308ccc93aaaa');
199197
}
200198
}

0 commit comments

Comments
 (0)