Beispiel #1
0
 public function runMigrations()
 {
     $phpmig = new PhpmigApplication($this->container, $this->output);
     $phpmig_adapter = $this->container->getPhpmigAdapter();
     if (!$phpmig_adapter->hasSchema()) {
         $phpmig_adapter->createSchema();
     }
     $phpmig->up();
 }
 /**
  * @covers ::up
  */
 public function testUp()
 {
     $adapter = $this->getAdapter(array($this->prev_version, $this->current_version));
     $migrations = $this->getMigrations();
     $this->createTestMigrations($migrations);
     $container = $this->getContainer($adapter, $migrations, $this->getTempDir());
     $container['phpmig.migrator'] = $this->getMigrator($adapter, $container, $this->output, 1, 0);
     $app = new PhpmigApplication($container, $this->output);
     $app->up($this->next_version);
 }
Beispiel #3
0
 /**
  * @covers ::up
  */
 public function testUp()
 {
     $adapter = $this->getAdapter(array($this->prev_version, $this->current_version));
     $adapter->expects($this->once())->method('hasSchema')->will($this->returnValue(false));
     $migrations = $this->getMigrations();
     $this->createTestMigrations($migrations);
     $container = $this->getContainer($adapter, $migrations, $this->getTempDir());
     $container['phpmig.migrator'] = $this->getMigrator($adapter, $container, $this->output, 1, 0);
     $app = new PhpmigApplication($container, $this->output);
     $app->up($this->next_version);
 }
 public function boot()
 {
     if (isset($this->biz['db.options'])) {
         $options = $this->biz['db.options'];
         $options['wrapperClass'] = 'Codeages\\Biz\\Framework\\Dao\\TestCaseConnection';
         $this->biz['db.options'] = $options;
     }
     BaseTestCase::setBiz($this->biz);
     BaseTestCase::emptyDatabase(true);
     $migration = new MigrationBootstrap($this->biz['db'], $this->biz['migration.directories']);
     $container = $migration->boot();
     $adapter = $container['phpmig.adapter'];
     if (!$adapter->hasSchema()) {
         $adapter->createSchema();
     }
     $app = new PhpmigApplication($container, new NullOutput());
     $app->up();
 }