Пример #1
0
 /**
  * @dataProvider providesSchemaFiles
  * @param string $xml
  */
 public function testZeroChangeOnSchemaMigrations($xml)
 {
     $xml = str_replace('*dbprefix*', $this->testPrefix, $xml);
     $schemaFile = 'static://test_db_scheme';
     file_put_contents($schemaFile, $xml);
     // apply schema
     $this->manager->createDbFromStructure($schemaFile);
     $schemaReader = new MDB2SchemaReader($this->config, $this->connection->getDatabasePlatform());
     $endSchema = $schemaReader->loadSchemaFromFile($schemaFile);
     // get the diff
     /** @var SchemaDiff $diff */
     $migrator = $this->manager->getMigrator();
     $diff = $this->invokePrivate($migrator, 'getDiff', [$endSchema, $this->connection]);
     // no sql statement is expected
     $sqls = $diff->toSql($this->connection->getDatabasePlatform());
     $this->assertEquals([], $sqls);
 }
Пример #2
0
 private function makeTestTable()
 {
     $schemaManager = new MDB2SchemaManager($this->connection);
     $schemaManager->createDbFromStructure(__DIR__ . '/testschema.xml');
 }