Skip to content

Commit f22ed0e

Browse files
authored
Merge pull request #200 from phpcr/fix-undefined-property
fix another undefined property
2 parents 4db6d3d + 120b519 commit f22ed0e

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

tests/Versioning/CreateVersionableNodeTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace PHPCR\Tests\Versioning;
1313

1414
use PHPCR\Test\BaseCase;
15+
use PHPCR\Version\VersionManagerInterface;
1516

1617
/**
1718
* Testing whether mix:versionable node type is properly handled.
@@ -20,6 +21,11 @@
2021
*/
2122
class 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);

tests/Versioning/VersionManagerTest.php

+11-13
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)