13 use \PHPUnit_Framework_MockObject_MockObject as Mock;
33 private $driverPoolMock;
38 private $configFilePool;
47 $this->dirListMock = $this->getMockBuilder(DirectoryList::class)
48 ->disableOriginalConstructor()
50 $this->driverPoolMock = $this->getMockBuilder(DriverPool::class)
51 ->disableOriginalConstructor()
53 $this->configFilePool = $this->getMockBuilder(ConfigFilePool::class)
54 ->disableOriginalConstructor()
56 $this->driverMock = $this->getMockBuilder(DriverInterface::class)
57 ->getMockForAbstractClass();
61 $this->driverPoolMock,
68 $fileKey =
'configKeyOne';
70 $this->dirListMock->expects($this->exactly(2))
73 ->willReturn(
__DIR__ .
'/_files');
74 $this->driverPoolMock->expects($this->exactly(2))
77 ->willReturn($this->driverMock);
78 $this->configFilePool->expects($this->exactly(2))
80 ->willReturnMap([[
'configKeyOne',
'config.php']]);
81 $this->driverMock->expects($this->exactly(2))
83 ->willReturnOnConsecutiveCalls(
true,
false);
85 ->expects($this->any())
87 ->willReturnMap([[
'configKeyOne',
'config.php']]);
89 $this->assertSame([
'fooKey' =>
'foo',
'barKey' =>
'bar'], $this->model->load($fileKey));
90 $this->assertSame([], $this->model->load($fileKey));
defined('TESTS_BP')||define('TESTS_BP' __DIR__