25 private $moduleManager;
40 private $changeRegistryFactory;
45 private $schemaConfig;
50 $this->moduleManager =
$objectManager->get(TestModuleManager::class);
52 $this->schemaConfig =
$objectManager->get(SchemaConfigInterface::class);
54 $this->changeRegistryFactory =
$objectManager->get(DiffFactory::class);
63 $this->moduleManager->updateRevision(
64 'Magento_TestSetupDeclarationModule1',
70 $this->moduleManager->updateRevision(
71 'Magento_TestSetupDeclarationModule1',
76 $this->cliCommad->install([
'Magento_TestSetupDeclarationModule1']);
78 $this->moduleManager->updateRevision(
79 'Magento_TestSetupDeclarationModule1',
84 $declarativeSchema = $this->schemaConfig->getDeclarationConfig();
85 $generatedSchema = $this->schemaConfig->getDbConfig();
86 $diff = $this->schemaDiff->diff($declarativeSchema, $generatedSchema);
87 $allChanges = $diff->getAll();
88 self::assertCount(1, $allChanges);
90 $this->getBigIntKeyXmlSensitiveData(),
91 reset($allChanges)[
'modify_column'][0]->getNew()->getDiffSensitiveParams()
94 $this->getBigIntKeyDbSensitiveData(),
95 reset($allChanges)[
'modify_column'][0]->getOld()->getDiffSensitiveParams()
107 $this->moduleManager->updateRevision(
108 'Magento_TestSetupDeclarationModule1',
113 $this->moduleManager->updateRevision(
114 'Magento_TestSetupDeclarationModule1',
119 $this->cliCommad->install(
120 [
'Magento_TestSetupDeclarationModule1'],
121 [
'db-prefix' => $dbPrefix]
124 $this->moduleManager->updateRevision(
125 'Magento_TestSetupDeclarationModule1',
130 $declarativeSchema = $this->schemaConfig->getDeclarationConfig();
131 $generatedSchema = $this->schemaConfig->getDbConfig();
132 $diff = $this->schemaDiff->diff($declarativeSchema, $generatedSchema);
133 self::assertEmpty($diff->getAll());
142 'Without db prefix' => [
145 'With db prefix' => [
146 'dbPrefix' =>
'spec_',
154 private function getBigIntKeyDbSensitiveData()
163 'comment' =>
'Bigint' 170 private function getBigIntKeyXmlSensitiveData()
179 'comment' =>
'Bigint',
testOldSchemaUpgrade(string $dbPrefix)
oldSchemaUpgradeDataProvider()
static getObjectManager()