File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed
dev/tests/setup-integration
framework/Magento/TestFramework/Deploy Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,18 @@ public function enableModule($moduleName)
72
72
/**
73
73
* Execute upgrade magento command.
74
74
*
75
+ * @param array $installParams
75
76
* @return string
76
77
*/
77
- public function upgrade ()
78
+ public function upgrade ($ installParams = [] )
78
79
{
79
80
$ initParams = $ this ->parametersHolder ->getInitParams ();
80
- $ enableModuleCommand = 'php -f ' . BP . '/bin/magento setup:upgrade -vvv -n --magento-init-params= '
81
+ $ upgradeCommand = 'php -f ' . BP . '/bin/magento setup:upgrade -vvv -n --magento-init-params= '
81
82
. $ initParams ['magento-init-params ' ];
82
- return $ this ->shell ->execute ($ enableModuleCommand );
83
+
84
+ $ upgradeCommand .= ' ' . implode (" " , $ this ->toCliArguments (array_keys ($ installParams )));
85
+
86
+ return $ this ->shell ->execute ($ upgradeCommand , array_values ($ installParams ));
83
87
}
84
88
85
89
/**
Original file line number Diff line number Diff line change @@ -53,9 +53,7 @@ public function testInstallation()
53
53
{
54
54
$ testTableData = $ this ->getData ();
55
55
$ row = reset ($ testTableData );
56
- $ this ->cliCommad ->install (
57
- ['Magento_TestSetupDeclarationModule4 ' ]
58
- );
56
+ $ this ->cliCommad ->install (['Magento_TestSetupDeclarationModule4 ' ]);
59
57
$ adapter = $ this ->resourceConnection ->getConnection ();
60
58
$ testTableName = $ this ->resourceConnection ->getTableName ('test_table ' );
61
59
$ adapter ->insertArray (
@@ -70,15 +68,23 @@ public function testInstallation()
70
68
'db_schema.xml ' ,
71
69
'etc '
72
70
);
73
- $ this ->cliCommad ->upgrade ();
71
+ $ this ->cliCommad ->upgrade (
72
+ [
73
+ '--safe-mode ' => true ,
74
+ ]
75
+ );
74
76
//Move new db_schema.xml with restored title field
75
77
$ this ->moduleManager ->updateRevision (
76
78
'Magento_TestSetupDeclarationModule4 ' ,
77
79
'restore_title_column ' ,
78
80
'db_schema.xml ' ,
79
81
'etc '
80
82
);
81
- $ this ->cliCommad ->upgrade ();
83
+ $ this ->cliCommad ->upgrade (
84
+ [
85
+ '--data-restore ' => true ,
86
+ ]
87
+ );
82
88
$ testTableSelect = $ adapter ->select ()->from ($ testTableName );
83
89
self ::assertEquals ($ testTableData , $ adapter ->fetchAll ($ testTableSelect ));
84
90
}
You can’t perform that action at this time.
0 commit comments