The purpose of this test is verifying declarative installation works.
Definition at line 22 of file DeclarativeInstallerTest.php.
◆ setUp()
◆ testDisableIndexByExternalModule()
testDisableIndexByExternalModule |
( |
| ) |
|
@moduleName Magento_TestSetupDeclarationModule1 @moduleName Magento_TestSetupDeclarationModule8
Definition at line 341 of file DeclarativeInstallerTest.php.
343 $this->cliCommad->install(
344 [
'Magento_TestSetupDeclarationModule1',
'Magento_TestSetupDeclarationModule8']
346 $this->moduleManager->updateRevision(
347 'Magento_TestSetupDeclarationModule1',
352 $this->moduleManager->updateRevision(
353 'Magento_TestSetupDeclarationModule8',
354 'disable_index_by_external_module',
358 $this->moduleManager->updateRevision(
359 'Magento_TestSetupDeclarationModule8',
360 'disable_index_by_external_module',
361 'db_schema_whitelist.json',
364 $this->moduleManager->updateRevision(
365 'Magento_TestSetupDeclarationModule8',
366 'disable_index_by_external_module',
370 $this->cliCommad->upgrade();
371 $tableStatements = $this->describeTable->describeShard(
'default');
372 $tableSql = $tableStatements[
'test_table'];
373 $this->assertNotRegExp(
374 '/KEY\s+`TEST_TABLE_VARCHAR`\s+\(`varchar`\)/',
376 'Index is not being disabled by external module'
◆ testForeignKeyReferenceId()
testForeignKeyReferenceId |
( |
| ) |
|
@moduleName Magento_TestSetupDeclarationModule8
Definition at line 319 of file DeclarativeInstallerTest.php.
321 $this->cliCommad->install(
322 [
'Magento_TestSetupDeclarationModule8']
324 $this->moduleManager->updateRevision(
325 'Magento_TestSetupDeclarationModule8',
326 'unpatterned_fk_name',
330 $this->cliCommad->upgrade();
331 $tableStatements = $this->describeTable->describeShard(
'default');
332 $tableSql = $tableStatements[
'dependent'];
333 $this->assertRegExp(
'/CONSTRAINT\s`DEPENDENT_PAGE_ID_ON_TEST_TABLE_PAGE_ID`/', $tableSql);
334 $this->assertRegExp(
'/CONSTRAINT\s`DEPENDENT_SCOPE_ID_ON_TEST_SCOPE_TABLE_SCOPE_ID`/', $tableSql);
◆ testInstallation()
◆ testInstallationWithColumnsModification()
testInstallationWithColumnsModification |
( |
| ) |
|
@moduleName Magento_TestSetupDeclarationModule1 @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/declarative_installer/column_modification.php
Definition at line 108 of file DeclarativeInstallerTest.php.
110 $this->cliCommad->install(
111 [
'Magento_TestSetupDeclarationModule1']
115 $this->moduleManager->updateRevision(
116 'Magento_TestSetupDeclarationModule1',
117 'column_modifications',
122 $this->cliCommad->install(
123 [
'Magento_TestSetupDeclarationModule1']
126 $diff = $this->schemaDiff->diff(
127 $this->schemaConfig->getDeclarationConfig(),
128 $this->schemaConfig->getDbConfig()
130 self::assertNull($diff->getAll());
131 $this->compareStructures();
◆ testInstallationWithColumnsRemoval()
testInstallationWithColumnsRemoval |
( |
| ) |
|
@moduleName Magento_TestSetupDeclarationModule1 @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/declarative_installer/column_removal.php
Definition at line 161 of file DeclarativeInstallerTest.php.
163 $this->cliCommad->install(
164 [
'Magento_TestSetupDeclarationModule1']
166 $this->updateDbSchemaRevision(
'column_removals');
167 $this->cliCommad->install(
168 [
'Magento_TestSetupDeclarationModule1']
171 $diff = $this->schemaDiff->diff(
172 $this->schemaConfig->getDeclarationConfig(),
173 $this->schemaConfig->getDbConfig()
175 self::assertNull($diff->getAll());
176 $this->compareStructures();
◆ testInstallationWithConstraintsModification()
testInstallationWithConstraintsModification |
( |
| ) |
|
@moduleName Magento_TestSetupDeclarationModule1 @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/declarative_installer/constraint_modification.php
Definition at line 199 of file DeclarativeInstallerTest.php.
201 $this->cliCommad->install(
202 [
'Magento_TestSetupDeclarationModule1']
204 $this->updateDbSchemaRevision(
'constraint_modifications');
205 $this->cliCommad->upgrade();
207 $diff = $this->schemaDiff->diff(
208 $this->schemaConfig->getDeclarationConfig(),
209 $this->schemaConfig->getDbConfig()
211 self::assertNull($diff->getAll());
213 self::assertEquals($this->getTrimmedData(), $shardData);
◆ testInstallationWithDroppingTables()
testInstallationWithDroppingTables |
( |
| ) |
|
@moduleName Magento_TestSetupDeclarationModule1 @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/declarative_installer/table_removal.php
Definition at line 220 of file DeclarativeInstallerTest.php.
222 $this->cliCommad->install(
223 [
'Magento_TestSetupDeclarationModule1']
227 $this->moduleManager->updateRevision(
228 'Magento_TestSetupDeclarationModule1',
234 $this->cliCommad->upgrade();
236 $diff = $this->schemaDiff->diff(
237 $this->schemaConfig->getDeclarationConfig(),
238 $this->schemaConfig->getDbConfig()
240 self::assertNull($diff->getAll());
242 self::assertEquals($this->
getData(), $shardData);
◆ testInstallWithCodeBaseRollback()
testInstallWithCodeBaseRollback |
( |
| ) |
|
@moduleName Magento_TestSetupDeclarationModule1 @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/declarative_installer/rollback.php
Definition at line 249 of file DeclarativeInstallerTest.php.
252 $this->moduleManager->updateRevision(
253 'Magento_TestSetupDeclarationModule1',
258 $this->cliCommad->install(
259 [
'Magento_TestSetupDeclarationModule1']
261 $beforeRollback = $this->describeTable->describeShard(
'default');
262 self::assertEquals($this->getTrimmedData()[
'before'], $beforeRollback);
264 $this->moduleManager->updateRevision(
265 'Magento_TestSetupDeclarationModule1',
271 $this->cliCommad->upgrade();
272 $afterRollback = $this->describeTable->describeShard(
'default');
273 self::assertEquals($this->
getData()[
'after'], $afterRollback);
◆ testTableRename()
@moduleName Magento_TestSetupDeclarationModule1 @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/declarative_installer/table_rename.php
Definition at line 280 of file DeclarativeInstallerTest.php.
282 $dataToMigrate = [
'some_column' =>
'Some Value'];
284 $this->moduleManager->updateRevision(
285 'Magento_TestSetupDeclarationModule1',
290 $this->cliCommad->install(
291 [
'Magento_TestSetupDeclarationModule1']
293 $before = $this->describeTable->describeShard(
'default');
294 $adapter = $this->resourceConnection->getConnection(
'default');
296 $this->resourceConnection->getTableName(
'some_table'),
299 self::assertEquals($this->
getData()[
'before'], $before[
'some_table']);
301 $this->moduleManager->updateRevision(
302 'Magento_TestSetupDeclarationModule1',
303 'table_rename_after',
308 $this->cliCommad->upgrade();
309 $after = $this->describeTable->describeShard(
'default');
310 self::assertEquals($this->
getData()[
'after'], $after[
'some_table_renamed']);
312 ->from($this->resourceConnection->getTableName(
'some_table_renamed'));
The documentation for this class was generated from the following file: