当前位置: 首页>>代码示例>>PHP>>正文


PHP Configuration::registerMigration方法代码示例

本文整理汇总了PHP中Doctrine\DBAL\Migrations\Configuration\Configuration::registerMigration方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::registerMigration方法的具体用法?PHP Configuration::registerMigration怎么用?PHP Configuration::registerMigration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\DBAL\Migrations\Configuration\Configuration的用法示例。


在下文中一共展示了Configuration::registerMigration方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testMigrateExecutesOlderVersionsThatHaveNetYetBeenMigrated

 /**
  * @see https://github.com/doctrine/migrations/issues/61
  * @group regresion
  * @dataProvider provideTestMigrationNames
  */
 public function testMigrateExecutesOlderVersionsThatHaveNetYetBeenMigrated(array $migrations)
 {
     foreach ($migrations as $key => $class) {
         $migration = new \Doctrine\DBAL\Migrations\Migration($this->config);
         $this->config->registerMigration($key, $class);
         $sql = $migration->migrate();
         $this->assertCount(1, $sql, 'should have executed one migration');
     }
 }
开发者ID:comporu,项目名称:migrations,代码行数:14,代码来源:FunctionalTest.php

示例2: testMigrateToCurrentVersionReturnsEmpty

 public function testMigrateToCurrentVersionReturnsEmpty()
 {
     $this->config->registerMigration(1, 'Doctrine\\DBAL\\Migrations\\Tests\\Functional\\MigrateAddSqlTest');
     $this->config->registerMigration(2, 'Doctrine\\DBAL\\Migrations\\Tests\\Functional\\MigrationMigrateFurther');
     $migration = new \Doctrine\DBAL\Migrations\Migration($this->config);
     $migration->migrate();
     $sql = $migration->migrate();
     $this->assertEquals(array(), $sql);
 }
开发者ID:glaucosydow,项目名称:curso-zf2,代码行数:9,代码来源:FunctionalTest.php

示例3: testAddSql

 public function testAddSql()
 {
     $this->config->registerMigration(1, 'Doctrine\\DBAL\\Migrations\\Tests\\Functional\\MigrateAddSqlTest');
     $migration = new \Doctrine\DBAL\Migrations\Migration($this->config);
     $migration->migrate(1);
     $migrations = $this->config->getMigrations();
     $this->assertTrue($migrations[1]->isMigrated());
     $schema = $this->config->getConnection()->getSchemaManager()->createSchema();
     $this->assertTrue($schema->hasTable('test_add_sql_table'));
     $check = $this->config->getConnection()->fetchAll('select * from test_add_sql_table');
     $this->assertNotEmpty($check);
     $this->assertEquals('test', $check[0]['test']);
     $migration->migrate(0);
     $this->assertFalse($migrations[1]->isMigrated());
     $schema = $this->config->getConnection()->getSchemaManager()->createSchema();
     $this->assertFalse($schema->hasTable('test_add_sql_table'));
 }
开发者ID:robertowest,项目名称:CuteFlow-V4,代码行数:17,代码来源:FunctionalTest.php

示例4: testDeleteOptionIfVersionNotMigrated

 /**
  * Test "--delete" option on not migrated version.
  *
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage The version "1233" does not exists in the version table.
  */
 public function testDeleteOptionIfVersionNotMigrated()
 {
     $this->configuration->registerMigration(1233, 'Doctrine\\DBAL\\Migrations\\Tests\\Stub\\Version1Test');
     $commandTester = new CommandTester($this->command);
     $commandTester->execute(array('--delete' => true, 'version' => 1233), array('interactive' => false));
 }
开发者ID:comporu,项目名称:migrations,代码行数:12,代码来源:MigrationVersionTest.php

示例5: registerMigration

 /**
  * {@inheritdoc}
  */
 public function registerMigration($version, $class)
 {
     $this->ensureMigrationClassExists($class);
     parent::registerMigration($version, $class);
 }
开发者ID:DIPcom,项目名称:Sandmin,代码行数:8,代码来源:Configuration.php


注:本文中的Doctrine\DBAL\Migrations\Configuration\Configuration::registerMigration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。