/** * 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(); }
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()); } }
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(); }