Esempio n. 1
0
 public function testSaveConfigOverride()
 {
     $configFiles = [ConfigFilePool::APP_CONFIG => 'test_conf.php', 'test_key' => 'test2_conf.php'];
     $testSetExisting = [ConfigFilePool::APP_CONFIG => ['foo' => 'bar', 'key' => 'value', 'baz' => ['test' => 'value', 'test1' => 'value1']]];
     $testSetUpdate = [ConfigFilePool::APP_CONFIG => ['baz' => ['test' => 'value2']]];
     $testSetExpected = [ConfigFilePool::APP_CONFIG => ['foo' => 'bar', 'key' => 'value', 'baz' => ['test' => 'value2']]];
     $this->deploymentConfig->expects($this->once())->method('resetData');
     $this->configFilePool->expects($this->once())->method('getPaths')->willReturn($configFiles);
     $this->dirWrite->expects($this->any())->method('isExist')->willReturn(true);
     $this->reader->expects($this->once())->method('load')->willReturn($testSetExisting[ConfigFilePool::APP_CONFIG]);
     $this->formatter->expects($this->once())->method('format')->with($testSetExpected[ConfigFilePool::APP_CONFIG])->willReturn([]);
     $this->dirWrite->expects($this->once())->method('writeFile')->with('test_conf.php', []);
     $this->object->saveConfig($testSetUpdate, true);
 }