99 * file that was distributed with this source code.
1010 */
1111
12- namespace PHPCR \Migrations \tests \Functional ;
12+ namespace PHPCR \Migrations \Tests \Functional ;
1313
14- use PHPCR \Migrations \BaseTestCase ;
1514use PHPCR \Migrations \Exception \MigratorException ;
1615use PHPCR \Migrations \Migrator ;
16+ use PHPCR \Migrations \Tests \BaseTestCase ;
1717use PHPCR \Migrations \VersionFinder ;
1818use PHPCR \Migrations \VersionStorage ;
1919use Symfony \Component \Console \Output \BufferedOutput ;
@@ -27,10 +27,11 @@ class MigrationTest extends BaseTestCase
2727
2828 private $ output ;
2929 private $ filesystem ;
30+ private $ migrationDistDir ;
3031 private $ migrationDir ;
3132 private $ storage ;
3233
33- public function setUp ()
34+ public function setUp (): void
3435 {
3536 $ this ->initPhpcr ();
3637 $ this ->migrationDir = __DIR__ . '/../migrations ' ;
@@ -63,9 +64,9 @@ public function testMigration()
6364 $ nodes = $ this ->session ->getNode ('/phpcrmig:versions ' )->getNodes ();
6465 $ names = array_keys ((array ) $ nodes );
6566
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 );
6970 }
7071
7172 /**
@@ -201,6 +202,7 @@ public function testMigratePrevious()
201202 $ this ->addVersion (self ::VERSION2 );
202203 $ this ->addVersion (self ::VERSION3 );
203204 $ migratedVersions = $ this ->getMigrator ()->migrate (null , $ this ->output );
205+ $ this ->assertCount (3 , $ migratedVersions );
204206 $ this ->assertEquals (self ::VERSION3 , $ this ->storage ->getCurrentVersion ());
205207
206208 $ migratedVersions = $ this ->getMigrator ()->migrate ('down ' , $ this ->output );
@@ -256,8 +258,7 @@ private function getMigrator()
256258 $ this ->storage = new VersionStorage ($ this ->session );
257259 $ finder = new VersionFinder (array ($ this ->migrationDir ));
258260 $ versions = $ finder ->getCollection ();
259- $ migrator = new Migrator ($ this ->session , $ versions , $ this ->storage );
260261
261- return $ migrator ;
262+ return new Migrator ( $ this -> session , $ versions , $ this -> storage ) ;
262263 }
263264}
0 commit comments