Ejemplo n.º 1
0
 public function rollbackMigrations()
 {
     $phpmig = new PhpmigApplication($this->container, $this->output);
     $phpmig_adapter = $this->container->getPhpmigAdapter();
     if (!$phpmig_adapter->hasSchema()) {
         $phpmig_adapter->createSchema();
     }
     $phpmig->down(0);
 }
Ejemplo n.º 2
0
 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();
 }
 /**
  * @covers ::getVersion
  */
 public function testGetVersion()
 {
     $migrations = $this->getMigrations();
     $this->createTestMigrations($migrations);
     $app = new PhpmigApplication($this->getContainer($this->getAdapter(array($this->current_version)), $migrations, $this->getTempDir()), $this->output);
     $this->assertEquals($this->current_version, $app->getVersion());
     $app = new PhpmigApplication($this->getContainer($this->getAdapter(), array(), $this->getTempDir()), $this->output);
     $this->assertEquals(0, $app->getVersion());
 }