Skip to content

Commit ac8215c

Browse files
committed
Merge pull request #124 from phpcr/test-uuid-move
add test for moving a referenceable node and checking uuid
2 parents 0570897 + 7166c34 commit ac8215c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

tests/10_Writing/MoveMethodsTest.php

+11-10
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,14 @@ public function testSessionMoveWhitespace()
190190
*/
191191
public function testSessionMoveReferenceable()
192192
{
193-
// has mix:referenceable
194-
$src = '/tests_write_manipulation_move/testSessionMoveReferenceable/srcNode';
195-
$dst = '/tests_write_manipulation_move/testSessionMoveReferenceable/dstNode/srcNode';
196-
197-
$srcUuid = $this->session->getNode($src)->getIdentifier();
193+
$dst = $this->node->getPath() . '/dstNode/srcNode';
194+
$node = $this->node->getNode('srcNode');
195+
$srcUuid = $node->getIdentifier();
196+
$src = $node->getPath();
198197
$this->session->move($src, $dst);
199198

199+
$this->assertSame($node, $this->session->getNodeByIdentifier($srcUuid));
200+
200201
// Session
201202
$this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]');
202203
$this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]');
@@ -302,8 +303,8 @@ public function testSessionMoveReplace()
302303
$dst = $this->node->getPath().'/moved';
303304
$src2 = $this->node->getPath().'/replacement';
304305

305-
$move = $this->node->getNode('node');
306-
$replacement = $this->node->getNode('replacement');
306+
$this->node->getNode('node');
307+
$this->node->getNode('replacement');
307308

308309
$this->session->move($src, $dst);
309310
$this->session->move($src2, $src);
@@ -356,9 +357,9 @@ public function testSessionMoveAdded()
356357
$this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]');
357358

358359
// Backend
359-
$this->session = $this->saveAndRenewSession();
360-
$this->assertFalse($this->session->nodeExists($src), 'Source node still exists [B]');
361-
$this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [B]');
360+
$session = $this->saveAndRenewSession();
361+
$this->assertFalse($session->nodeExists($src), 'Source node still exists [B]');
362+
$this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]');
362363

363364
$session = $this->saveAndRenewSession();
364365
$this->assertFalse($session->nodeExists($src), 'Source child node still exists [B]');

0 commit comments

Comments
 (0)