File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -146,10 +146,12 @@ public function testRemoveNodeParentState()
146146 */
147147 public function testRemoveNodeFromBackend ()
148148 {
149- $ node = $ this ->rootNode ->addNode ('toBeDeleted ' , 'nt:unstructured ' );
150- $ this ->sharedFixture ['session ' ]->save ();
151-
152- $ this ->renewSession ();
149+ $ nodename = 'toBeDeleted ' ;
150+ if (! $ this ->rootNode ->hasNode ($ nodename )) {
151+ $ this ->rootNode ->addNode ($ nodename , 'nt:unstructured ' );
152+ $ this ->sharedFixture ['session ' ]->save ();
153+ $ this ->renewSession ();
154+ }
153155
154156 $ node = $ this ->sharedFixture ['session ' ]->getNode ('/toBeDeleted ' );
155157
@@ -160,7 +162,6 @@ public function testRemoveNodeFromBackend()
160162
161163 $ this ->setExpectedException ('\PHPCR\PathNotFoundException ' );
162164 $ this ->sharedFixture ['session ' ]->getNode ('/toBeDeleted ' );
163-
164165 }
165166
166167 /**
Original file line number Diff line number Diff line change @@ -107,7 +107,8 @@ public function testFilteredEventJournalNodeType()
107107
108108 // Make the root node have a UUID
109109 $ root = $ session ->getRootNode ();
110- $ root ->addNode ('unstructured ' );
110+ $ node = $ root ->addNode ('/tests_observation ' );
111+ $ node ->addNode ('unstructured ' );
111112 $ session ->save ();
112113
113114 // 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()
120121
121122 // At this point the journal
122123 $ this ->assertTrue ($ journal ->valid ());
123- $ this ->assertEquals ('/unstructured ' , $ journal ->current ()->getPath ());
124+ $ this ->assertEquals ('/tests_observation/ unstructured ' , $ journal ->current ()->getPath ());
124125 $ this ->assertEquals (EventInterface::NODE_ADDED , $ journal ->current ()->getType ());
125126
126127 $ journal ->next ();
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ protected function setUp()
2323 }
2424 parent ::setUp ();
2525 }
26+
2627 public function testPurge ()
2728 {
2829 /** @var $session \PHPCR\SessionInterface */
@@ -40,6 +41,10 @@ public function testPurge()
4041 $ session ->save ();
4142
4243 NodeHelper::purgeWorkspace ($ session );
44+ if ($ session ->getWorkspace ()->getName () == 'crx.default ' ) {
45+ // if we would continue, we would delete all content from the only real workspace
46+ $ this ->markTestIncomplete ('TODO: how to test this with crx where we have no workspaces? ' );
47+ }
4348 $ session ->save ();
4449
4550 // if there where system nodes, they should still be here
You can’t perform that action at this time.
0 commit comments