@@ -646,4 +646,54 @@ public function iCloneNodeFromTo($arg1, $arg2, $arg3)
646646 $ workspace = $ session ->getWorkspace ();
647647 $ workspace ->cloneFrom ($ arg2 , $ arg1 , $ arg3 , false );
648648 }
649+
650+ /**
651+ * @Given /^the node "([^"]*)" is locked$/
652+ */
653+ public function theNodeIsLocked ($ arg1 )
654+ {
655+ $ session = $ this ->getSession ();
656+ $ workspace = $ session ->getWorkspace ();
657+ $ lockManager = $ workspace ->getLockManager ();
658+ $ lockManager ->lock ($ arg1 , true , true );
659+ }
660+
661+ /**
662+ * @Given /^the node "([^"]*)" is not locked$/
663+ */
664+ public function theNodeIsNotLocked ($ arg1 )
665+ {
666+ $ session = $ this ->getSession ();
667+ $ workspace = $ session ->getWorkspace ();
668+ $ lockManager = $ workspace ->getLockManager ();
669+ if ($ lockManager ->isLocked ($ arg1 )) {
670+ $ lockManager ->unlock ($ arg1 );
671+ }
672+ }
673+
674+ /**
675+ * @Given /^the node "([^"]*)" should be locked$/
676+ */
677+ public function theNodeShouldBeLocked ($ arg1 )
678+ {
679+ $ session = $ this ->getSession ();
680+ $ workspace = $ session ->getWorkspace ();
681+ $ lockManager = $ workspace ->getLockManager ();
682+ $ isLocked = $ lockManager ->isLocked ($ arg1 );
683+
684+ PHPUnit_Framework_Assert::assertTrue ($ isLocked );
685+ }
686+
687+ /**
688+ * @Given /^the node "([^"]*)" should not be locked$/
689+ */
690+ public function theNodeShouldNotBeLocked ($ arg1 )
691+ {
692+ $ session = $ this ->getSession ();
693+ $ workspace = $ session ->getWorkspace ();
694+ $ lockManager = $ workspace ->getLockManager ();
695+ $ isLocked = $ lockManager ->isLocked ($ arg1 );
696+
697+ PHPUnit_Framework_Assert::assertFalse ($ isLocked );
698+ }
649699}
0 commit comments