Skip to content

Commit 73158ef

Browse files
committed
MAGETWO-35136: Delete Segments
- updating to use correct key from config.
1 parent 52c9b75 commit 73158ef

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

dev/tests/functional/lib/Magento/Mtf/App/State/AbstractState.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
use Magento\Framework\App\Filesystem\DirectoryList;
1010
use Magento\Framework\Config\ConfigOptionsList;
11+
use Magento\Framework\App\DeploymentConfig\Reader;
12+
use Magento\Framework\App\DeploymentConfig;
1113

1214
/**
1315
* Abstract class AbstractState
@@ -42,9 +44,10 @@ public function clearInstance()
4244
$dirList = \Magento\Mtf\ObjectManagerFactory::getObjectManager()
4345
->get('Magento\Framework\Filesystem\DirectoryList');
4446

45-
$reader = new \Magento\Framework\App\DeploymentConfig\Reader($dirList);
46-
$deploymentConfig = new \Magento\Framework\App\DeploymentConfig($reader);
47-
$dbInfo = $deploymentConfig->getConfigData(ConfigOptionsList::CONFIG_PATH_DB_CONNECTION_DEFAULT);
47+
$reader = new Reader($dirList);
48+
$deploymentConfig = new DeploymentConfig($reader);
49+
$dbConfig = $deploymentConfig->getConfigData(ConfigOptionsList::KEY_DB);
50+
$dbInfo = $dbConfig['connection']['default'];
4851
$host = $dbInfo['host'];
4952
$user = $dbInfo['username'];
5053
$password = $dbInfo['password'];

dev/tests/integration/framework/Magento/TestFramework/Application.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\App\Filesystem\DirectoryList;
1212
use Magento\Framework\App\DeploymentConfig;
1313
use Magento\Framework\Config\ConfigOptionsList;
14+
use Magento\Framework\App\DeploymentConfig\Reader;
1415

1516
/**
1617
* Encapsulates application installation, initialization and uninstall
@@ -161,9 +162,10 @@ public function getDbInstance()
161162
{
162163
if (null === $this->_db) {
163164
if ($this->isInstalled()) {
164-
$reader = new \Magento\Framework\App\DeploymentConfig\Reader($this->dirList);
165+
$reader = new Reader($this->dirList);
165166
$deploymentConfig = new DeploymentConfig($reader, []);
166-
$dbInfo = $deploymentConfig->getConfigData(ConfigOptionsList::CONFIG_PATH_DB_CONNECTION_DEFAULT);
167+
$dbConfig = $deploymentConfig->getConfigData(ConfigOptionsList::KEY_DB);
168+
$dbInfo = $dbConfig['connection']['default'];
167169
$host = $dbInfo['host'];
168170
$user = $dbInfo['username'];
169171
$password = $dbInfo['password'];

0 commit comments

Comments
 (0)