File tree Expand file tree Collapse file tree 3 files changed +13
-11
lines changed
dev/tests/setup-integration
setup/src/Magento/Setup/Validator Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ return [
10
10
'db-user' => '{{db-user}}',
11
11
'db-password' => '{{db-password}}',
12
12
'db-name' => '{{db-name}}',
13
+ 'db-init-statements' => '{{db-init-statements}}',
13
14
'db-prefix' => '',
14
15
'backend-frontname' => 'admin',
15
16
'admin-user' => 'admin',
Original file line number Diff line number Diff line change 83
83
$ application ->createInstallDir ();
84
84
//We do not want to install anything
85
85
$ application ->initialize ([]);
86
- $ application ->cleanup ();
86
+
87
+ if ($ settings ->getAsBoolean ('TESTS_CLEANUP ' )) {
88
+ $ application ->cleanup ();
89
+ }
87
90
88
91
\Magento \TestFramework \Helper \Bootstrap::setInstance (new \Magento \TestFramework \Helper \Bootstrap ($ bootstrap ));
89
92
Original file line number Diff line number Diff line change @@ -141,17 +141,15 @@ public function checkDatabaseConnectionWithDriverOptions(
141
141
*/
142
142
private function checkDatabaseName (\Magento \Framework \DB \Adapter \AdapterInterface $ connection , $ dbName )
143
143
{
144
- $ query = "SHOW DATABASES " ;
145
- $ accessibleDbs = $ connection ->query ($ query )->fetchAll (\PDO ::FETCH_COLUMN , 0 );
146
- foreach ($ accessibleDbs as $ accessibleDbName ) {
147
- if ($ dbName == $ accessibleDbName ) {
148
- return true ;
149
- }
144
+ try {
145
+ $ connection ->query ("SHOW TABLES FROM $ dbName " )->fetchAll (\PDO ::FETCH_COLUMN , 0 );
146
+ return true ;
147
+ } catch (\Exception $ e ) {
148
+ throw new \Magento \Setup \Exception (
149
+ "Database ' {$ dbName }' does not exist "
150
+ . "or specified database server user does not have privileges to access this database. "
151
+ );
150
152
}
151
- throw new \Magento \Setup \Exception (
152
- "Database ' {$ dbName }' does not exist "
153
- ."or specified database server user does not have privileges to access this database. "
154
- );
155
153
}
156
154
157
155
/**
You can’t perform that action at this time.
0 commit comments