Exemplo n.º 1
0
 /**
  * @param Migration $migration
  * @param           $timeQueries
  * @param           $sql
  */
 protected function writeNotes(Migration $migration, $timeQueries, $sql)
 {
     if (count($sql) < 1) {
         $this->notes[] = '<info>Nothing to migrate.</info>';
     }
     foreach ($sql as $versionName => $sql) {
         $this->note($versionName, $migration->getConfiguration()->getVersion($versionName), $timeQueries);
     }
 }
 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());
 }