File tree 3 files changed +16
-3
lines changed
3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1
1
language : php
2
2
3
3
php :
4
- - 5.4
5
- - 5.5
6
4
- 5.6
5
+ - 7.0
7
6
8
7
before_script :
9
8
- composer install
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public function __construct(
41
41
public function initialize ()
42
42
{
43
43
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. ' );
45
45
}
46
46
47
47
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()
159
159
$ this ->assertCount (2 , $ nodes );
160
160
}
161
161
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
+
162
176
/**
163
177
* It should migrate to the next version.
164
178
*/
You can’t perform that action at this time.
0 commit comments