File tree Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 1212namespace PHPCR \Tests \Versioning ;
1313
1414use PHPCR \Test \BaseCase ;
15+ use PHPCR \Version \VersionManagerInterface ;
1516
1617/**
1718* Testing whether mix:versionable node type is properly handled.
2021*/
2122class CreateVersionableNodeTest extends BaseCase
2223{
24+ /**
25+ * @var VersionManagerInterface
26+ */
27+ private $ vm ;
28+
2329 public static function setupBeforeClass ($ fixtures = '15_Versioning/base ' ): void
2430 {
2531 parent ::setupBeforeClass ($ fixtures );
Original file line number Diff line number Diff line change @@ -447,20 +447,18 @@ public function testRestoreNonexistingName()
447447 $ this ->vm ->restore (true , 'not-existing ' , '/tests_version_base/versioned ' );
448448 }
449449
450- public function testRestoreNonsenseArguments ()
450+ public function testRestoreNoPath ()
451451 {
452- try {
453- $ this ->vm ->restore (true , 'something ' );
454- $ this ->fail ('restoring with version name and no path should throw an exception ' );
455- } catch (Exception $ e ) {
456- // we expect something to be thrown
457- }
458- try {
459- $ this ->vm ->restore (true , $ this );
460- $ this ->fail ('restoring with non-version object ' );
461- } catch (Exception $ e ) {
462- // we expect something to be thrown
463- }
452+ $ this ->expectException (\Exception::class);
453+
454+ $ this ->vm ->restore (true , 'something ' );
455+ }
456+
457+ public function testRestoreInvalidType ()
458+ {
459+ $ this ->expectException (\Exception::class);
460+
461+ $ this ->vm ->restore (true , $ this );
464462 }
465463
466464 public function testRestoreRootVersion ()
You can’t perform that action at this time.
0 commit comments