17 private $configImporterPoolMock;
22 private $deploymentConfigMock;
27 private $dataCollector;
34 $this->configImporterPoolMock = $this->getMockBuilder(ImporterPool::class)
35 ->disableOriginalConstructor()
37 $this->deploymentConfigMock = $this->getMockBuilder(DeploymentConfig::class)
38 ->disableOriginalConstructor()
41 $this->dataCollector =
new DataCollector($this->configImporterPoolMock, $this->deploymentConfigMock);
49 $sections = [
'first',
'second'];
50 $this->configImporterPoolMock->expects($this->once())
51 ->method(
'getSections')
52 ->willReturn($sections);
53 $this->deploymentConfigMock->expects($this->atLeastOnce())
54 ->method(
'getConfigData')
55 ->willReturnMap([[
'first',
'some data']]);
57 $this->assertSame([
'first' =>
'some data',
'second' =>
null], $this->dataCollector->getConfig());
65 $this->configImporterPoolMock->expects($this->never())
66 ->method(
'getSections');
67 $this->deploymentConfigMock->expects($this->atLeastOnce())
68 ->method(
'getConfigData')
69 ->willReturnMap([[
'someSection',
'some data']]);
70 $this->assertSame([
'someSection' =>
'some data'], $this->dataCollector->getConfig(
'someSection'));
testGetConfigSpecificSection()