Skip to content

Commit 437fa37

Browse files
committed
Fixed tests for PHP5.4
1 parent cd98ebb commit 437fa37

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

lib/VersionStorage.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,15 @@ public function getPersistedVersions()
6060
{
6161
$this->init();
6262

63-
$versions = $this->storageNode->getNodeNames();
63+
$versionNodes = $this->storageNode->getNodes();
64+
$versions = array();
65+
66+
foreach ($versionNodes as $versionNode) {
67+
$versions[$versionNode->getName()] = array(
68+
'name' => $versionNode->getName(),
69+
'executed' => $versionNode->getPropertyValue('jcr:created'),
70+
);
71+
}
6472

6573
return $versions;
6674
}

tests/Unit/MigratorFactoryTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ class MigratorFactoryTest extends \PHPUnit_Framework_TestCase
2222
{
2323
public function testFactory()
2424
{
25-
$storage = $this->prophesize(VersionStorage::class);
26-
$finder = $this->prophesize(VersionFinder::class);
27-
$session = $this->prophesize(SessionInterface::class);
28-
$finder->getCollection()->willReturn($this->prophesize(VersionCollection::class)->reveal());
25+
$storage = $this->prophesize('DTL\PhpcrMigrations\VersionStorage');
26+
$finder = $this->prophesize('DTL\PhpcrMigrations\VersionFinder');
27+
$session = $this->prophesize('PHPCR\SessionInterface');
28+
$finder->getCollection()->willReturn($this->prophesize('DTL\PhpcrMigrations\VersionCollection')->reveal());
2929

3030
$factory = new MigratorFactory(
3131
$storage->reveal(),
3232
$finder->reveal(),
3333
$session->reveal()
3434
);
3535
$migrator = $factory->getMigrator();
36-
$this->assertInstanceOf(Migrator::class, $migrator);
36+
$this->assertInstanceOf('DTL\PhpcrMigrations\Migrator', $migrator);
3737
}
3838
}

tests/Unit/VersionCollectionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class VersionCollectionTest extends \PHPUnit_Framework_TestCase
2222

2323
public function setUp()
2424
{
25-
$this->version1 = $this->prophesize(VersionInterface::class);
26-
$this->version2 = $this->prophesize(VersionInterface::class);
27-
$this->version3 = $this->prophesize(VersionInterface::class);
25+
$this->version1 = $this->prophesize('DTL\PhpcrMigrations\VersionInterface');
26+
$this->version2 = $this->prophesize('DTL\PhpcrMigrations\VersionInterface');
27+
$this->version3 = $this->prophesize('DTL\PhpcrMigrations\VersionInterface');
2828
}
2929

3030
/**

tests/Unit/VersionFinderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function setUp()
3131
public function testGetCollection()
3232
{
3333
$collection = $this->finder->getCollection();
34-
$this->assertInstanceOf(VersionCollection::class, $collection);
34+
$this->assertInstanceOf('DTL\PhpcrMigrations\VersionCollection', $collection);
3535
$versions = $collection->getAllVersions();
3636
$this->assertCount(3, $versions);
3737
}

0 commit comments

Comments
 (0)