From b0b3fc1d7af81d99bcdd0081fb9fb835145b29f8 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Fri, 30 Oct 2015 10:22:22 +0100 Subject: [PATCH] adding a functional test for the node helper. works fine with jackrabbit --- tests/PhpcrUtils/NodeHelperTest.php | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/PhpcrUtils/NodeHelperTest.php diff --git a/tests/PhpcrUtils/NodeHelperTest.php b/tests/PhpcrUtils/NodeHelperTest.php new file mode 100644 index 00000000..e6c2e53e --- /dev/null +++ b/tests/PhpcrUtils/NodeHelperTest.php @@ -0,0 +1,51 @@ +markTestSkipped('This testbed does not have phpcr-utils available'); + } + parent::setUp(); + } + + public function testCreatePartialPath() + { + $node = NodeHelper::createPath($this->session, '/tests_general_base/index.txt/jcr:content/test/node'); + $this->assertInstanceOf('PHPCR\NodeInterface', $node); + $this->session->save(); + } + + public function testCreateNewPath() + { + $node = NodeHelper::createPath($this->session, '/tests_nodehelper/test/node'); + $this->assertInstanceOf('PHPCR\NodeInterface', $node); + $this->session->save(); + } + + public function testCreateExistingPath() + { + $node = NodeHelper::createPath($this->session, '/tests_general_base/index.txt'); + $this->assertInstanceOf('PHPCR\NodeInterface', $node); + $this->assertFalse($this->session->hasPendingChanges()); + } +}