9
9
* file that was distributed with this source code.
10
10
*/
11
11
12
- namespace PHPCR \Migrations \tests \Functional ;
12
+ namespace PHPCR \Migrations \Tests \Functional ;
13
13
14
- use PHPCR \Migrations \BaseTestCase ;
15
14
use PHPCR \Migrations \Exception \MigratorException ;
16
15
use PHPCR \Migrations \Migrator ;
16
+ use PHPCR \Migrations \Tests \BaseTestCase ;
17
17
use PHPCR \Migrations \VersionFinder ;
18
18
use PHPCR \Migrations \VersionStorage ;
19
19
use Symfony \Component \Console \Output \BufferedOutput ;
@@ -27,10 +27,11 @@ class MigrationTest extends BaseTestCase
27
27
28
28
private $ output ;
29
29
private $ filesystem ;
30
+ private $ migrationDistDir ;
30
31
private $ migrationDir ;
31
32
private $ storage ;
32
33
33
- public function setUp ()
34
+ public function setUp (): void
34
35
{
35
36
$ this ->initPhpcr ();
36
37
$ this ->migrationDir = __DIR__ . '/../migrations ' ;
@@ -63,9 +64,9 @@ public function testMigration()
63
64
$ nodes = $ this ->session ->getNode ('/phpcrmig:versions ' )->getNodes ();
64
65
$ names = array_keys ((array ) $ nodes );
65
66
66
- $ this ->assertContains (' 201501011200 ' , $ names );
67
- $ this ->assertContains (' 201501011212 ' , $ names );
68
- $ this ->assertContains (' 201501011215 ' , $ names );
67
+ $ this ->assertContains (201501011200 , $ names );
68
+ $ this ->assertContains (201501011212 , $ names );
69
+ $ this ->assertContains (201501011215 , $ names );
69
70
}
70
71
71
72
/**
@@ -201,6 +202,7 @@ public function testMigratePrevious()
201
202
$ this ->addVersion (self ::VERSION2 );
202
203
$ this ->addVersion (self ::VERSION3 );
203
204
$ migratedVersions = $ this ->getMigrator ()->migrate (null , $ this ->output );
205
+ $ this ->assertCount (3 , $ migratedVersions );
204
206
$ this ->assertEquals (self ::VERSION3 , $ this ->storage ->getCurrentVersion ());
205
207
206
208
$ migratedVersions = $ this ->getMigrator ()->migrate ('down ' , $ this ->output );
@@ -256,8 +258,7 @@ private function getMigrator()
256
258
$ this ->storage = new VersionStorage ($ this ->session );
257
259
$ finder = new VersionFinder (array ($ this ->migrationDir ));
258
260
$ versions = $ finder ->getCollection ();
259
- $ migrator = new Migrator ($ this ->session , $ versions , $ this ->storage );
260
261
261
- return $ migrator ;
262
+ return new Migrator ( $ this -> session , $ versions , $ this -> storage ) ;
262
263
}
263
264
}
0 commit comments