From 7b6212bd25e2270aa0bc22c70b06a2167f8f3577 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai <mchellathura@ebay.com> Date: Thu, 7 May 2015 11:37:58 -0500 Subject: [PATCH] MAGETWO-36920: Use dashes instead of underscores in option names - db-host - db-name - db-user - db-password - db-prefix - db-model - db_init_statements --- .../config/install-config-mysql.php.dist | 8 ++++---- .../integration/etc/install-config-mysql.php.dist | 10 +++++----- .../etc/install-config-mysql.travis.php.dist | 10 +++++----- .../Magento/TestFramework/Application.php | 8 ++++---- .../integration/testsuite/Magento/DatabaseTest.php | 2 +- dev/tests/performance/config.php.dist | 8 ++++---- .../Magento/Framework/Config/ConfigOptionsList.php | 14 +++++++------- .../Unit/Console/Command/ConfigSetCommandTest.php | 10 +++++----- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/dev/tests/api-functional/config/install-config-mysql.php.dist b/dev/tests/api-functional/config/install-config-mysql.php.dist index 4f126261b28..cfba75530f5 100644 --- a/dev/tests/api-functional/config/install-config-mysql.php.dist +++ b/dev/tests/api-functional/config/install-config-mysql.php.dist @@ -9,10 +9,10 @@ return [ 'language' => 'en_US', 'timezone' => 'America/Los_Angeles', 'currency' => 'USD', - 'db_host' => 'localhost', - 'db_name' => 'magento_functional_tests', - 'db_user' => 'root', - 'db_password' => '', + 'db-host' => 'localhost', + 'db-name' => 'magento_functional_tests', + 'db-user' => 'root', + 'db-password' => '', 'backend-frontname' => 'backend', 'base_url' => 'http://localhost/', 'use_secure' => '0', diff --git a/dev/tests/integration/etc/install-config-mysql.php.dist b/dev/tests/integration/etc/install-config-mysql.php.dist index 1887855e3a1..f579d253ccf 100644 --- a/dev/tests/integration/etc/install-config-mysql.php.dist +++ b/dev/tests/integration/etc/install-config-mysql.php.dist @@ -5,11 +5,11 @@ */ return [ - 'db_host' => 'localhost', - 'db_user' => 'root', - 'db_password' => '', - 'db_name' => 'magento_integration_tests', - 'db_prefix' => '', + 'db-host' => 'localhost', + 'db-user' => 'root', + 'db-password' => '', + 'db-name' => 'magento_integration_tests', + 'db-prefix' => '', 'backend-frontname' => 'backend', 'admin_user' => \Magento\TestFramework\Bootstrap::ADMIN_NAME, 'admin_password' => \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD, diff --git a/dev/tests/integration/etc/install-config-mysql.travis.php.dist b/dev/tests/integration/etc/install-config-mysql.travis.php.dist index 5e4a2a51384..b539cd8ef05 100644 --- a/dev/tests/integration/etc/install-config-mysql.travis.php.dist +++ b/dev/tests/integration/etc/install-config-mysql.travis.php.dist @@ -5,11 +5,11 @@ */ return [ - 'db_host' => '127.0.0.1', - 'db_user' => 'travis', - 'db_password' => '', - 'db_name' => 'magento_integration_tests', - 'db_prefix' => 'travis_', + 'db-host' => '127.0.0.1', + 'db-user' => 'travis', + 'db-password' => '', + 'db-name' => 'magento_integration_tests', + 'db-prefix' => 'travis_', 'backend-frontname' => 'backend', 'admin_user' => \Magento\TestFramework\Bootstrap::ADMIN_NAME, 'admin_password' => \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD, diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index d8aee09eb18..59cd2c536d4 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -172,10 +172,10 @@ class Application $dbName = $dbInfo['dbname']; } else { $installConfig = $this->getInstallConfig(); - $host = $installConfig['db_host']; - $user = $installConfig['db_user']; - $password = $installConfig['db_password']; - $dbName = $installConfig['db_name']; + $host = $installConfig['db-host']; + $user = $installConfig['db-user']; + $password = $installConfig['db-password']; + $dbName = $installConfig['db-name']; } $this->_db = new Db\Mysql( $host, diff --git a/dev/tests/integration/testsuite/Magento/DatabaseTest.php b/dev/tests/integration/testsuite/Magento/DatabaseTest.php index 4058fcb2b44..77e767b03f9 100644 --- a/dev/tests/integration/testsuite/Magento/DatabaseTest.php +++ b/dev/tests/integration/testsuite/Magento/DatabaseTest.php @@ -21,7 +21,7 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase $db = Bootstrap::getInstance()->getBootstrap()->getApplication()->getDbInstance(); $command = $checkerPath . ' -d ' . $db->getSchema() - . ' h=' . $db->getHost()['db_host'] . ',u=' . $db->getUser() . ',p=' . $db->getPassword(); + . ' h=' . $db->getHost()['db-host'] . ',u=' . $db->getUser() . ',p=' . $db->getPassword(); exec($command, $output, $exitCode); $this->assertEquals(0, $exitCode); diff --git a/dev/tests/performance/config.php.dist b/dev/tests/performance/config.php.dist index 5e70a3617ac..968022b8e0d 100644 --- a/dev/tests/performance/config.php.dist +++ b/dev/tests/performance/config.php.dist @@ -13,10 +13,10 @@ return array( 'language' => 'en_US', 'timezone' => 'America/Los_Angeles', 'currency' => 'USD', - 'db_host' => 'localhost', - 'db_name' => 'magento', - 'db_user' => 'root', - 'db_password' => '', + 'db-host' => 'localhost', + 'db-name' => 'magento', + 'db-user' => 'root', + 'db-password' => '', 'use_secure' => '0', 'use_secure_admin' => '0', 'use_rewrites' => '0', diff --git a/lib/internal/Magento/Framework/Config/ConfigOptionsList.php b/lib/internal/Magento/Framework/Config/ConfigOptionsList.php index ef296a21b31..a520389a24a 100644 --- a/lib/internal/Magento/Framework/Config/ConfigOptionsList.php +++ b/lib/internal/Magento/Framework/Config/ConfigOptionsList.php @@ -34,13 +34,13 @@ class ConfigOptionsList implements ConfigOptionsListInterface const INPUT_KEY_ENCRYPTION_KEY = 'key'; const INPUT_KEY_SESSION_SAVE = 'session-save'; const INPUT_KEY_DEFINITION_FORMAT = 'definition-format'; - const INPUT_KEY_DB_HOST = 'db_host'; - const INPUT_KEY_DB_NAME = 'db_name'; - const INPUT_KEY_DB_USER = 'db_user'; - const INPUT_KEY_DB_PASSWORD = 'db_password'; - const INPUT_KEY_DB_PREFIX = 'db_prefix'; - const INPUT_KEY_DB_MODEL = 'db_model'; - const INPUT_KEY_DB_INIT_STATEMENTS = 'db_init_statements'; + const INPUT_KEY_DB_HOST = 'db-host'; + const INPUT_KEY_DB_NAME = 'db-name'; + const INPUT_KEY_DB_USER = 'db-user'; + const INPUT_KEY_DB_PASSWORD = 'db-password'; + const INPUT_KEY_DB_PREFIX = 'db-prefix'; + const INPUT_KEY_DB_MODEL = 'db-model'; + const INPUT_KEY_DB_INIT_STATEMENTS = 'db-init-statements'; const INPUT_KEY_RESOURCE = 'resource'; /**#@-*/ diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/ConfigSetCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/ConfigSetCommandTest.php index 11e08c4faf7..5e7ee9a76a3 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/ConfigSetCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/ConfigSetCommandTest.php @@ -33,7 +33,7 @@ class ConfigSetCommandTest extends \PHPUnit_Framework_TestCase $option ->expects($this->any()) ->method('getName') - ->will($this->returnValue('db_host')); + ->will($this->returnValue('db-host')); $this->configModel = $this->getMock('Magento\Setup\Model\ConfigModel', [], [], '', false); $this->configModel ->expects($this->exactly(2)) @@ -53,9 +53,9 @@ class ConfigSetCommandTest extends \PHPUnit_Framework_TestCase $this->configModel ->expects($this->once()) ->method('process') - ->with(['db_host' => 'host']); + ->with(['db-host' => 'host']); $commandTester = new CommandTester($this->command); - $commandTester->execute(['--db_host' => 'host']); + $commandTester->execute(['--db-host' => 'host']); $this->assertSame( 'You saved the new configuration.' . PHP_EOL, $commandTester->getDisplay() @@ -71,7 +71,7 @@ class ConfigSetCommandTest extends \PHPUnit_Framework_TestCase $this->configModel ->expects($this->once()) ->method('process') - ->with(['db_host' => 'host']); + ->with(['db-host' => 'host']); $this->checkInteraction(true); } @@ -112,7 +112,7 @@ class ConfigSetCommandTest extends \PHPUnit_Framework_TestCase $this->command->setHelperSet($helperSet); $commandTester = new CommandTester($this->command); - $commandTester->execute(['--db_host' => 'host']); + $commandTester->execute(['--db-host' => 'host']); if ($interactionType) { $message = 'You saved the new configuration.' . PHP_EOL; } else { -- GitLab