@@ -43,17 +43,18 @@ protected function setUp()
43
43
->willReturn (__DIR__ . '/_files ' );
44
44
$ this ->fileDriver = $ this ->createMock (File::class);
45
45
$ this ->fileDriver
46
- ->expects ($ this ->any ())
47
46
->method ('isExists ' )
48
- ->will ($ this ->returnValueMap ([
49
- [__DIR__ . '/_files/config.php ' , true ],
50
- [__DIR__ . '/_files/custom.php ' , true ],
51
- [__DIR__ . '/_files/duplicateConfig.php ' , true ],
52
- [__DIR__ . '/_files/env.php ' , true ],
53
- [__DIR__ . '/_files/mergeOne.php ' , true ],
54
- [__DIR__ . '/_files/mergeTwo.php ' , true ],
55
- [__DIR__ . '/_files/nonexistent.php ' , false ]
56
- ]));
47
+ ->willReturnMap (
48
+ [
49
+ [__DIR__ .'/_files/config.php ' , true ],
50
+ [__DIR__ .'/_files/custom.php ' , true ],
51
+ [__DIR__ .'/_files/duplicateConfig.php ' , true ],
52
+ [__DIR__ .'/_files/env.php ' , true ],
53
+ [__DIR__ .'/_files/mergeOne.php ' , true ],
54
+ [__DIR__ .'/_files/mergeTwo.php ' , true ],
55
+ [__DIR__ .'/_files/nonexistent.php ' , false ]
56
+ ]
57
+ );
57
58
$ this ->driverPool = $ this ->createMock (DriverPool::class);
58
59
$ this ->driverPool
59
60
->expects ($ this ->any ())
@@ -152,8 +153,9 @@ public function testLoadInvalidConfigurationFileWithFileKey()
152
153
* @expectedException \Magento\Framework\Exception\RuntimeException
153
154
* @expectedExceptionMessageRegExp /Invalid configuration file: \'.*\/\_files\/emptyConfig\.php\'/
154
155
* @return void
156
+ * @throws \Magento\Framework\Exception\FileSystemException
155
157
*/
156
- public function testLoadInvalidConfigurationFile ()
158
+ public function testLoadInvalidConfigurationFile (): void
157
159
{
158
160
$ fileDriver = $ this ->getMockBuilder (File::class)
159
161
->disableOriginalConstructor ()
@@ -173,23 +175,14 @@ public function testLoadInvalidConfigurationFile()
173
175
$ configFilePool = $ this ->getMockBuilder (ConfigFilePool::class)
174
176
->disableOriginalConstructor ()
175
177
->getMock ();
176
- $ configFilePool ->expects ($ this ->exactly ( 2 ))
178
+ $ configFilePool ->expects ($ this ->once ( ))
177
179
->method ('getPaths ' )
178
180
->willReturn (
179
181
[
180
182
'configKeyOne ' => 'config.php ' ,
181
183
'testConfig ' => 'emptyConfig.php '
182
184
]
183
185
);
184
- $ configFilePool ->expects ($ this ->exactly (2 ))
185
- ->method ('getPath ' )
186
- ->withConsecutive (
187
- [$ this ->identicalTo ('configKeyOne ' )],
188
- [$ this ->identicalTo ('testConfig ' )]
189
- )->willReturnOnConsecutiveCalls (
190
- 'config.php ' ,
191
- 'emptyConfig.php '
192
- );
193
186
$ object = new Reader ($ this ->dirList , $ driverPool , $ configFilePool );
194
187
$ object ->load ();
195
188
}
0 commit comments