コード例 #1
0
 /**
  * Initializes the migrated, available and current versions
  *
  * @return void
  */
 private function initializeVersions()
 {
     $env = $this->manager->getEnvironment($this->environment);
     $this->migratedVersions = $env->getVersions();
     $this->availableVersions = $this->manager->getMigrations();
     $this->currentVersion = $env->getCurrentVersion();
 }
コード例 #2
0
ファイル: ManagerTest.php プロジェクト: Slayug/castor
 public function testGettingOutputObject()
 {
     $migrations = $this->manager->getMigrations();
     $outputObject = $this->manager->getOutput();
     $this->assertInstanceOf('\\Symfony\\Component\\Console\\Output\\OutputInterface', $outputObject);
     foreach ($migrations as $migration) {
         $this->assertEquals($outputObject, $migration->getOutput());
     }
 }
コード例 #3
0
ファイル: ManagerTest.php プロジェクト: askzap/ultimate
 public function testGetMigrationsWithClassThatDoesntExtendAbstractMigration()
 {
     $this->setExpectedException('InvalidArgumentException', 'The class "InvalidSuperClass" in file "' . implode(DIRECTORY_SEPARATOR, array(__DIR__, '_files', 'invalidsuperclass', '20120111235330_invalid_super_class.php')) . '" must extend \\Phinx\\Migration\\AbstractMigration');
     $config = new Config(array('paths' => array('migrations' => __DIR__ . '/_files/invalidsuperclass')));
     $output = new StreamOutput(fopen('php://memory', 'a', false));
     $manager = new Manager($config, $output);
     $manager->getMigrations();
 }