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 [
1010 'db-user' => '{{db-user}}',
1111 'db-password' => '{{db-password}}',
1212 'db-name' => '{{db-name}}',
13+ 'db-init-statements' => '{{db-init-statements}}',
1314 'db-prefix' => '',
1415 'backend-frontname' => 'admin',
1516 'admin-user' => 'admin',
Original file line number Diff line number Diff line change 8383 $ application ->createInstallDir ();
8484 //We do not want to install anything
8585 $ application ->initialize ([]);
86- $ application ->cleanup ();
86+
87+ if ($ settings ->getAsBoolean ('TESTS_CLEANUP ' )) {
88+ $ application ->cleanup ();
89+ }
8790
8891 \Magento \TestFramework \Helper \Bootstrap::setInstance (new \Magento \TestFramework \Helper \Bootstrap ($ bootstrap ));
8992
Original file line number Diff line number Diff line change @@ -141,17 +141,15 @@ public function checkDatabaseConnectionWithDriverOptions(
141141 */
142142 private function checkDatabaseName (\Magento \Framework \DB \Adapter \AdapterInterface $ connection , $ dbName )
143143 {
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+ );
150152 }
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- );
155153 }
156154
157155 /**
You can’t perform that action at this time.
0 commit comments