9 use \Magento\Framework\App\DeploymentConfig;
10 use \Magento\Framework\Config\ConfigOptionsListConstants;
17 private static $fixture = [
18 'configData1' =>
'scalar_value',
21 'bar' => [
'baz' => 2],
28 private static $flattenedFixture = [
29 'configData1' =>
'scalar_value',
32 'bar' => [
'baz' => 2],
34 'configData2/foo' => 1,
35 'configData2/bar' => [
'baz' => 2],
36 'configData2/bar/baz' => 2,
66 self::$fixtureConfig = require
__DIR__ .
'/_files/config.php';
67 self::$fixtureConfigMerged = require
__DIR__ .
'/_files/other/local_developer_merged.php';
73 $this->_deploymentConfig = new \Magento\Framework\App\DeploymentConfig($this->reader, []);
74 $this->_deploymentConfigMerged = new \Magento\Framework\App\DeploymentConfig(
76 require
__DIR__ .
'/_files/other/local_developer.php' 82 $this->reader->expects($this->once())->method(
'load')->willReturn(self::$fixture);
83 $this->assertSame(self::$flattenedFixture, $this->_deploymentConfig->get());
85 $this->assertSame(self::$flattenedFixture, $this->_deploymentConfig->get());
86 $this->assertSame(
'scalar_value', $this->_deploymentConfig->getConfigData(
'configData1'));
87 $this->assertSame(self::$fixture[
'configData2'], $this->_deploymentConfig->getConfigData(
'configData2'));
92 $this->reader->expects($this->once())->method(
'load')->willReturn([
96 $this->assertTrue($object->isAvailable());
101 $this->reader->expects($this->once())->method(
'load')->willReturn([]);
103 $this->assertFalse($object->isAvailable());
108 $this->reader->expects($this->at(0))->method(
'load')->willReturn([]);
109 $this->reader->expects($this->at(1))->method(
'load')->willReturn([
113 $this->assertFalse($object->isAvailable());
114 $this->assertTrue($object->isAvailable());
125 $this->reader->expects($this->once())->method(
'load')->willReturn(
$data);
137 [
'foo' => [
'bar' =>
'1'],
'foo/bar' =>
'2'],
138 [
'foo/bar' =>
'1',
'foo' => [
'bar' =>
'2']],
139 [
'foo' => [
'subfoo' => [
'subbar' =>
'1'],
'subfoo/subbar' =>
'2'],
'bar' =>
'3'],
const CONFIG_PATH_INSTALL_DATE
defined('TESTS_BP')||define('TESTS_BP' __DIR__
keyCollisionDataProvider()
static setUpBeforeClass()
testNotAvailableThenAvailable()
static $fixtureConfigMerged
testKeyCollision(array $data)