File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public function __construct(
4141 public function initialize ()
4242 {
4343 if ($ this ->versionStorage ->hasVersioningNode ()) {
44- throw MigratorException ('Will not re-initialize ' );
44+ throw new MigratorException ('This repository has already been initialized. Will not re-initialize. ' );
4545 }
4646
4747 foreach (array_keys ($ this ->versionCollection ->getAllVersions ()) as $ timestamp ) {
Original file line number Diff line number Diff line change @@ -159,6 +159,20 @@ public function testInitialize()
159159 $ this ->assertCount (2 , $ nodes );
160160 }
161161
162+ /**
163+ * It should throw an exception if trying to reiniitialize.
164+ *
165+ * @expectedException PHPCR\Migrations\Exception\MigratorException
166+ * @expectedExceptionMessage Will not re-initialize
167+ */
168+ public function testReinitialize ()
169+ {
170+ $ this ->addVersion (self ::VERSION1 );
171+ $ this ->addVersion (self ::VERSION2 );
172+ $ this ->getMigrator ()->initialize ();
173+ $ this ->getMigrator ()->initialize ();
174+ }
175+
162176 /**
163177 * It should migrate to the next version.
164178 */
You can’t perform that action at this time.
0 commit comments