Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0

before_script:
- composer install
Expand Down
2 changes: 1 addition & 1 deletion lib/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
public function initialize()
{
if ($this->versionStorage->hasVersioningNode()) {
throw MigratorException('Will not re-initialize');
throw new MigratorException('This repository has already been initialized. Will not re-initialize.');
}

foreach (array_keys($this->versionCollection->getAllVersions()) as $timestamp) {
Expand Down
14 changes: 14 additions & 0 deletions tests/Functional/MigrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,20 @@ public function testInitialize()
$this->assertCount(2, $nodes);
}

/**
* It should throw an exception if trying to reiniitialize.
*
* @expectedException PHPCR\Migrations\Exception\MigratorException
* @expectedExceptionMessage Will not re-initialize
*/
public function testReinitialize()
{
$this->addVersion(self::VERSION1);
$this->addVersion(self::VERSION2);
$this->getMigrator()->initialize();
$this->getMigrator()->initialize();
}

/**
* It should migrate to the next version.
*/
Expand Down