Skip to content

Commit

Permalink
Merge pull request #200 from phpcr/fix-undefined-property
Browse files Browse the repository at this point in the history
fix another undefined property
  • Loading branch information
dbu authored Dec 2, 2023
2 parents 4db6d3d + 120b519 commit f22ed0e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
6 changes: 6 additions & 0 deletions tests/Versioning/CreateVersionableNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace PHPCR\Tests\Versioning;

use PHPCR\Test\BaseCase;
use PHPCR\Version\VersionManagerInterface;

/**
* Testing whether mix:versionable node type is properly handled.
Expand All @@ -20,6 +21,11 @@
*/
class CreateVersionableNodeTest extends BaseCase
{
/**
* @var VersionManagerInterface
*/
private $vm;

public static function setupBeforeClass($fixtures = '15_Versioning/base'): void
{
parent::setupBeforeClass($fixtures);
Expand Down
24 changes: 11 additions & 13 deletions tests/Versioning/VersionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,20 +447,18 @@ public function testRestoreNonexistingName()
$this->vm->restore(true, 'not-existing', '/tests_version_base/versioned');
}

public function testRestoreNonsenseArguments()
public function testRestoreNoPath()
{
try {
$this->vm->restore(true, 'something');
$this->fail('restoring with version name and no path should throw an exception');
} catch (Exception $e) {
// we expect something to be thrown
}
try {
$this->vm->restore(true, $this);
$this->fail('restoring with non-version object');
} catch (Exception $e) {
// we expect something to be thrown
}
$this->expectException(\Exception::class);

$this->vm->restore(true, 'something');
}

public function testRestoreInvalidType()
{
$this->expectException(\Exception::class);

$this->vm->restore(true, $this);
}

public function testRestoreRootVersion()
Expand Down

0 comments on commit f22ed0e

Please sign in to comment.