File tree 2 files changed +44
-0
lines changed
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 209
209
</sv : node >
210
210
</sv : node >
211
211
212
+ <sv : node sv : name =" testDeletePreviouslyReferencedNodeInMultipleProperty" >
213
+ <sv : property sv : name =" jcr:primaryType" sv : type =" Name" >
214
+ <sv : value >nt:unstructured</sv : value >
215
+ </sv : property >
216
+ <sv : property sv : name =" reference" sv : type =" Reference" sv : multiple =" true" >
217
+ <sv : value >7aa10003-0cba-4820-a3e4-f9b1ae8126de</sv : value >
218
+ <sv : value >7aa10003-0cba-4820-a3e4-f9b1ae8126de</sv : value >
219
+ </sv : property >
220
+
221
+ <sv : node sv : name =" idExample" >
222
+ <sv : property sv : name =" jcr:primaryType" sv : type =" Name" >
223
+ <sv : value >nt:unstructured</sv : value >
224
+ </sv : property >
225
+ <sv : property sv : name =" jcr:mixinTypes" sv : type =" Name" >
226
+ <sv : value >mix:referenceable</sv : value >
227
+ </sv : property >
228
+ <sv : property sv : name =" jcr:uuid" sv : type =" String" >
229
+ <sv : value >7aa10003-0cba-4820-a3e4-f9b1ae8126de</sv : value >
230
+ </sv : property >
231
+ </sv : node >
232
+ </sv : node >
233
+
212
234
<sv : node sv : name =" testDeleteWeakReferencedNode" >
213
235
<sv : property sv : name =" jcr:primaryType" sv : type =" Name" >
214
236
<sv : value >nt:unstructured</sv : value >
Original file line number Diff line number Diff line change @@ -450,6 +450,28 @@ public function testDeletePreviouslyReferencedNode()
450
450
$ this ->assertFalse ($ this ->node ->hasNode ($ this ->getName ()));
451
451
}
452
452
453
+ /**
454
+ * however, if the reference is first deleted, it must be possible to
455
+ * delete the node, also if it is an multiple reference property
456
+ */
457
+ public function testDeletePreviouslyReferencedNodeInMultipleProperty ()
458
+ {
459
+ //relies on the base class setup trick to have the node populated from the fixtures
460
+ $ this ->assertInstanceOf ('PHPCR\NodeInterface ' , $ this ->node );
461
+
462
+ // 2) Get the referencing property and delete it
463
+ $ sourceprop = $ this ->node ->getProperty ('reference ' );
464
+ $ sourceprop ->setValue (array ());
465
+
466
+ // 4) Load the previously referenced node and remove it
467
+ $ destnode = $ this ->node ->getNode ('idExample ' );
468
+
469
+ $ destnode ->remove ();
470
+ $ this ->saveAndRenewSession ();
471
+
472
+ $ this ->assertFalse ($ this ->node ->hasNode ($ this ->getName ()));
473
+ }
474
+
453
475
/**
454
476
* it must be possible to delete a weakly referenced node.
455
477
*/
You can’t perform that action at this time.
0 commit comments