From 7166c34db15ae787ddd5d9a8a0099f6938225b80 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sat, 4 Jan 2014 16:35:28 +0100 Subject: [PATCH] add test for moving a referenceable node and checking uuid --- tests/10_Writing/MoveMethodsTest.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/10_Writing/MoveMethodsTest.php b/tests/10_Writing/MoveMethodsTest.php index 41890c16..4c2f71ce 100644 --- a/tests/10_Writing/MoveMethodsTest.php +++ b/tests/10_Writing/MoveMethodsTest.php @@ -190,13 +190,14 @@ public function testSessionMoveWhitespace() */ public function testSessionMoveReferenceable() { - // has mix:referenceable - $src = '/tests_write_manipulation_move/testSessionMoveReferenceable/srcNode'; - $dst = '/tests_write_manipulation_move/testSessionMoveReferenceable/dstNode/srcNode'; - - $srcUuid = $this->session->getNode($src)->getIdentifier(); + $dst = $this->node->getPath() . '/dstNode/srcNode'; + $node = $this->node->getNode('srcNode'); + $srcUuid = $node->getIdentifier(); + $src = $node->getPath(); $this->session->move($src, $dst); + $this->assertSame($node, $this->session->getNodeByIdentifier($srcUuid)); + // Session $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [S]'); $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]'); @@ -302,8 +303,8 @@ public function testSessionMoveReplace() $dst = $this->node->getPath().'/moved'; $src2 = $this->node->getPath().'/replacement'; - $move = $this->node->getNode('node'); - $replacement = $this->node->getNode('replacement'); + $this->node->getNode('node'); + $this->node->getNode('replacement'); $this->session->move($src, $dst); $this->session->move($src2, $src); @@ -356,9 +357,9 @@ public function testSessionMoveAdded() $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [S]'); // Backend - $this->session = $this->saveAndRenewSession(); - $this->assertFalse($this->session->nodeExists($src), 'Source node still exists [B]'); - $this->assertTrue($this->session->nodeExists($dst), 'Destination node not found [B]'); + $session = $this->saveAndRenewSession(); + $this->assertFalse($session->nodeExists($src), 'Source node still exists [B]'); + $this->assertTrue($session->nodeExists($dst), 'Destination node not found [B]'); $session = $this->saveAndRenewSession(); $this->assertFalse($session->nodeExists($src), 'Source child node still exists [B]');