|
3 | 3 | * Copyright © 2015 Magento. All rights reserved.
|
4 | 4 | * See COPYING.txt for license details.
|
5 | 5 | */
|
6 |
| - |
7 | 6 | namespace Magento\Setup\Test\Unit\Model;
|
8 | 7 |
|
9 |
| - |
10 | 8 | use Magento\Framework\Config\ConfigOptionsListConstants;
|
| 9 | +use Magento\Framework\App\State; |
11 | 10 |
|
12 | 11 | class ConfigGeneratorTest extends \PHPUnit_Framework_TestCase
|
13 | 12 | {
|
14 | 13 | /** @var \Magento\Framework\App\DeploymentConfig | \PHPUnit_Framework_MockObject_MockObject */
|
15 | 14 | private $deploymentConfigMock;
|
| 15 | + |
16 | 16 | /** @var \Magento\Setup\Model\ConfigGenerator | \PHPUnit_Framework_MockObject_MockObject */
|
17 | 17 | private $model;
|
18 | 18 |
|
@@ -58,4 +58,24 @@ public function testCreateCacheHostsConfig()
|
58 | 58 | $configData = $this->model->createCacheHostsConfig($data);
|
59 | 59 | $this->assertEquals($expectedData, $configData->getData()[ConfigOptionsListConstants::CONFIG_PATH_CACHE_HOSTS]);
|
60 | 60 | }
|
| 61 | + |
| 62 | + public function testCreateModeConfig() |
| 63 | + { |
| 64 | + $this->deploymentConfigMock->expects($this->once()) |
| 65 | + ->method('get') |
| 66 | + ->with(State::PARAM_MODE) |
| 67 | + ->willReturn(null); |
| 68 | + $configData = $this->model->createModeConfig(); |
| 69 | + $this->assertSame(State::MODE_DEFAULT, $configData->getData()[State::PARAM_MODE]); |
| 70 | + } |
| 71 | + |
| 72 | + public function testCreateModeConfigIfAlreadySet() |
| 73 | + { |
| 74 | + $this->deploymentConfigMock->expects($this->once()) |
| 75 | + ->method('get') |
| 76 | + ->with(State::PARAM_MODE) |
| 77 | + ->willReturn(State::MODE_PRODUCTION); |
| 78 | + $configData = $this->model->createModeConfig(); |
| 79 | + $this->assertSame([], $configData->getData()); |
| 80 | + } |
61 | 81 | }
|
0 commit comments