public function test_can_make_migration() { $this->configuration->shouldReceive('resolveVersionAlias')->andReturn('version3'); $this->configuration->shouldReceive('getMigratedVersions')->andReturn(['version1']); $this->configuration->shouldReceive('getAvailableVersions')->andReturn(['version1', 'version2', 'version3']); $migration = new Migration($this->configuration, 'latest'); $this->assertInstanceOf(\Doctrine\DBAL\Migrations\Migration::class, $migration->getMigration()); $this->assertEquals('version3', $migration->getVersion()); }
/** * @param Migration $migration * @param string|bool $path */ public function migrateToFile(Migration $migration, $path) { $path = is_bool($path) ? getcwd() : $path; $sql = $migration->getMigration()->writeSqlFile($path, $migration->getVersion()); $this->writeNotes($migration, false, $sql); }