Skip to content

Commit 9354b7a

Browse files
committed
Merge remote-tracking branch 'origin/B2B-1986-PR' into B2B-2079-combined
2 parents d925f50 + 52ad0e3 commit 9354b7a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,13 @@ public function testCheckDatabaseConnectionDbNotAccessible()
127127
->expects($this->atLeastOnce())
128128
->method('query')
129129
->willReturn($pdo);
130-
$accessibleDbs = ['some_db', 'another_db'];
131130

132131
$pdo->expects($this->atLeastOnce())
133132
->method('fetchAll')
134-
->willReturn($accessibleDbs);
133+
->willThrowException(
134+
new \Zend_Db_Statement_Exception("1044 - Access denied for user 'user'@'host' to database 'name'")
135+
);
136+
135137
$this->dbValidator->checkDatabaseConnection('name', 'host', 'user', 'password');
136138
}
137139

setup/src/Magento/Setup/Validator/DbValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class DbValidator
1919
/**
2020
* Db prefix max length
2121
*/
22-
const DB_PREFIX_LENGTH = 5;
22+
public const DB_PREFIX_LENGTH = 5;
2323

2424
/**
2525
* DB connection factory

0 commit comments

Comments
 (0)