Skip to content

Commit 775653a

Browse files
committed
MAGETWO-87482: Build stabilization
1 parent d54b6ab commit 775653a

File tree

1 file changed

+45
-0
lines changed
  • dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Mtf\Util\Command\Cli;
8+
9+
use Magento\Mtf\Util\Command\Cli;
10+
11+
/**
12+
* Handle set configuration for test execution.
13+
*/
14+
class Config extends Cli
15+
{
16+
/**
17+
* Parameter for reindex command.
18+
*/
19+
const PARAM_CONFIG_SET = 'config:set';
20+
21+
/**
22+
* Set configuration.
23+
*
24+
* @param string $path
25+
* @param string $value
26+
* @param string|null $scope
27+
* @param string|null $scopeCode
28+
* @return void
29+
*/
30+
public function setConfig($path, $value, $scope = null, $scopeCode = null)
31+
{
32+
$configurationString = '';
33+
34+
if ($scope !== null) {
35+
$configurationString.= sprintf('--scope=%s ', $scope);
36+
}
37+
38+
if ($scopeCode !== null) {
39+
$configurationString.= sprintf('--scope-code=%s ', $scopeCode);
40+
}
41+
$configurationString.= sprintf('%s %s', $path, $value);
42+
43+
parent::execute(Config::PARAM_CONFIG_SET . ' ' . $configurationString);
44+
}
45+
}

0 commit comments

Comments
 (0)