diff --git a/tests/10_Writing/DeleteMethodsTest.php b/tests/10_Writing/DeleteMethodsTest.php index 35ef7753..870d4fc2 100644 --- a/tests/10_Writing/DeleteMethodsTest.php +++ b/tests/10_Writing/DeleteMethodsTest.php @@ -146,10 +146,12 @@ public function testRemoveNodeParentState() */ public function testRemoveNodeFromBackend() { - $node = $this->rootNode->addNode('toBeDeleted', 'nt:unstructured'); - $this->sharedFixture['session']->save(); - - $this->renewSession(); + $nodename = 'toBeDeleted'; + if (! $this->rootNode->hasNode($nodename)) { + $this->rootNode->addNode($nodename, 'nt:unstructured'); + $this->sharedFixture['session']->save(); + $this->renewSession(); + } $node = $this->sharedFixture['session']->getNode('/toBeDeleted'); @@ -160,7 +162,6 @@ public function testRemoveNodeFromBackend() $this->setExpectedException('\PHPCR\PathNotFoundException'); $this->sharedFixture['session']->getNode('/toBeDeleted'); - } /** diff --git a/tests/12_Observation/ObservationManagerTest.php b/tests/12_Observation/ObservationManagerTest.php index 93857681..b224b02c 100644 --- a/tests/12_Observation/ObservationManagerTest.php +++ b/tests/12_Observation/ObservationManagerTest.php @@ -107,7 +107,8 @@ public function testFilteredEventJournalNodeType() // Make the root node have a UUID $root = $session->getRootNode(); - $root->addNode('unstructured'); + $node = $root->addNode('/tests_observation'); + $node->addNode('unstructured'); $session->save(); // At this point the journal contains 3 events: PROP_ADDED (for setting the node type of the new node) @@ -120,7 +121,7 @@ public function testFilteredEventJournalNodeType() // At this point the journal $this->assertTrue($journal->valid()); - $this->assertEquals('/unstructured', $journal->current()->getPath()); + $this->assertEquals('/tests_observation/unstructured', $journal->current()->getPath()); $this->assertEquals(EventInterface::NODE_ADDED, $journal->current()->getType()); $journal->next(); diff --git a/tests/PhpcrUtils/PurgeTest.php b/tests/PhpcrUtils/PurgeTest.php index df8e0ea2..26cdaaed 100644 --- a/tests/PhpcrUtils/PurgeTest.php +++ b/tests/PhpcrUtils/PurgeTest.php @@ -23,6 +23,7 @@ protected function setUp() } parent::setUp(); } + public function testPurge() { /** @var $session \PHPCR\SessionInterface */ @@ -40,6 +41,10 @@ public function testPurge() $session->save(); NodeHelper::purgeWorkspace($session); + if ($session->getWorkspace()->getName() == 'crx.default') { + // if we would continue, we would delete all content from the only real workspace + $this->markTestIncomplete('TODO: how to test this with crx where we have no workspaces?'); + } $session->save(); // if there where system nodes, they should still be here