@@ -73,7 +73,7 @@ class InstallerTest extends TestCase
73
73
ConfigOptionsListConstants::INPUT_KEY_DB_NAME => 'magento ' ,
74
74
ConfigOptionsListConstants::INPUT_KEY_DB_USER => 'magento ' ,
75
75
ConfigOptionsListConstants::INPUT_KEY_ENCRYPTION_KEY => 'encryption_key ' ,
76
- ConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => 'backend ' ,
76
+ ConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => 'backend '
77
77
];
78
78
79
79
/**
@@ -200,7 +200,7 @@ class InstallerTest extends TestCase
200
200
ConfigOptionsListConstants::KEY_HOST => '127.0.0.1 ' ,
201
201
ConfigOptionsListConstants::KEY_NAME => 'magento ' ,
202
202
ConfigOptionsListConstants::KEY_USER => 'magento ' ,
203
- ConfigOptionsListConstants::KEY_PASSWORD => '' ,
203
+ ConfigOptionsListConstants::KEY_PASSWORD => ''
204
204
]
205
205
];
206
206
@@ -219,6 +219,9 @@ class InstallerTest extends TestCase
219
219
*/
220
220
private $ patchApplierFactoryMock ;
221
221
222
+ /**
223
+ * @inheritdoc
224
+ */
222
225
protected function setUp (): void
223
226
{
224
227
$ this ->filePermissions = $ this ->createMock (FilePermissions::class);
@@ -368,37 +371,41 @@ public function testInstall(array $request, array $logMessages)
368
371
$ this ->dataSetupFactory ->expects ($ this ->atLeastOnce ())->method ('create ' )->willReturn ($ dataSetup );
369
372
$ this ->objectManager ->expects ($ this ->any ())
370
373
->method ('create ' )
371
- ->willReturnMap ([
372
- [Manager::class, [], $ cacheManager ],
373
- [\Magento \Framework \App \State::class, [], $ appState ],
374
- [
375
- PatchApplierFactory::class,
376
- ['objectManager ' => $ this ->objectManager ],
377
- $ this ->patchApplierFactoryMock
378
- ],
379
- ]);
374
+ ->willReturnMap (
375
+ [
376
+ [Manager::class, [], $ cacheManager ],
377
+ [\Magento \Framework \App \State::class, [], $ appState ],
378
+ [
379
+ PatchApplierFactory::class,
380
+ ['objectManager ' => $ this ->objectManager ],
381
+ $ this ->patchApplierFactoryMock
382
+ ],
383
+ ]
384
+ );
380
385
$ this ->patchApplierMock ->expects ($ this ->exactly (2 ))->method ('applySchemaPatch ' )->willReturnMap (
381
386
[
382
387
['Bar_Two ' ],
383
- ['Foo_One ' ],
388
+ ['Foo_One ' ]
384
389
]
385
390
);
386
391
$ this ->patchApplierMock ->expects ($ this ->exactly (2 ))->method ('applyDataPatch ' )->willReturnMap (
387
392
[
388
393
['Bar_Two ' ],
389
- ['Foo_One ' ],
394
+ ['Foo_One ' ]
390
395
]
391
396
);
392
397
$ this ->objectManager ->expects ($ this ->any ())
393
398
->method ('get ' )
394
- ->willReturnMap ([
395
- [\Magento \Framework \App \State::class, $ appState ],
396
- [Manager::class, $ cacheManager ],
397
- [DeclarationInstaller::class, $ this ->declarationInstallerMock ],
398
- [Registry::class, $ registry ],
399
- [SearchConfig::class, $ searchConfigMock ],
400
- [RemoteStorageValidator::class, $ remoteStorageValidatorMock ],
401
- ]);
399
+ ->willReturnMap (
400
+ [
401
+ [\Magento \Framework \App \State::class, $ appState ],
402
+ [Manager::class, $ cacheManager ],
403
+ [DeclarationInstaller::class, $ this ->declarationInstallerMock ],
404
+ [Registry::class, $ registry ],
405
+ [SearchConfig::class, $ searchConfigMock ],
406
+ [RemoteStorageValidator::class, $ remoteStorageValidatorMock ]
407
+ ]
408
+ );
402
409
$ this ->adminFactory ->expects ($ this ->any ())->method ('create ' )->willReturn (
403
410
$ this ->createMock (AdminAccount::class)
404
411
);
@@ -488,7 +495,7 @@ public function installDataProvider()
488
495
AdminAccount::KEY_PASSWORD => '123 ' ,
489
496
AdminAccount::KEY_EMAIL => 'admin@example.com ' ,
490
497
AdminAccount::KEY_FIRST_NAME => 'John ' ,
491
- AdminAccount::KEY_LAST_NAME => 'Doe ' ,
498
+ AdminAccount::KEY_LAST_NAME => 'Doe '
492
499
],
493
500
'logMessages ' => [
494
501
['Starting Magento installation: ' ],
@@ -654,31 +661,35 @@ public function testInstallWithInvalidRemoteStorageConfiguration(bool $isDeploym
654
661
655
662
$ this ->objectManager ->expects (static ::any ())
656
663
->method ('create ' )
657
- ->willReturnMap ([
658
- [Manager::class, [], $ cacheManager ],
659
- [\Magento \Framework \App \State::class, [], $ appState ],
660
- [
661
- PatchApplierFactory::class,
662
- ['objectManager ' => $ this ->objectManager ],
663
- $ this ->patchApplierFactoryMock
664
- ]
665
- ]);
664
+ ->willReturnMap (
665
+ [
666
+ [Manager::class, [], $ cacheManager ],
667
+ [\Magento \Framework \App \State::class, [], $ appState ],
668
+ [
669
+ PatchApplierFactory::class,
670
+ ['objectManager ' => $ this ->objectManager ],
671
+ $ this ->patchApplierFactoryMock
672
+ ]
673
+ ]
674
+ );
666
675
$ this ->patchApplierMock ->expects (static ::exactly (2 ))->method ('applySchemaPatch ' )->willReturnMap (
667
676
[
668
677
['Bar_Two ' ],
669
- ['Foo_One ' ],
678
+ ['Foo_One ' ]
670
679
]
671
680
);
672
681
$ this ->objectManager ->expects (static ::any ())
673
682
->method ('get ' )
674
- ->willReturnMap ([
675
- [\Magento \Framework \App \State::class, $ appState ],
676
- [Manager::class, $ cacheManager ],
677
- [DeclarationInstaller::class, $ this ->declarationInstallerMock ],
678
- [Registry::class, $ registry ],
679
- [SearchConfig::class, $ searchConfigMock ],
680
- [RemoteStorageValidator::class, $ remoteStorageValidatorMock ]
681
- ]);
683
+ ->willReturnMap (
684
+ [
685
+ [\Magento \Framework \App \State::class, $ appState ],
686
+ [Manager::class, $ cacheManager ],
687
+ [DeclarationInstaller::class, $ this ->declarationInstallerMock ],
688
+ [Registry::class, $ registry ],
689
+ [SearchConfig::class, $ searchConfigMock ],
690
+ [RemoteStorageValidator::class, $ remoteStorageValidatorMock ]
691
+ ]
692
+ );
682
693
683
694
$ this ->sampleDataState ->expects (static ::never ())->method ('hasError ' );
684
695
@@ -808,25 +819,27 @@ public function testInstallWithUnresolvableRemoteStorageValidator()
808
819
$ this ->dataSetupFactory ->expects (static ::atLeastOnce ())->method ('create ' )->willReturn ($ dataSetup );
809
820
$ this ->objectManager ->expects (static ::any ())
810
821
->method ('create ' )
811
- ->willReturnMap ([
812
- [Manager::class, [], $ cacheManager ],
813
- [\Magento \Framework \App \State::class, [], $ appState ],
814
- [
815
- PatchApplierFactory::class,
816
- ['objectManager ' => $ this ->objectManager ],
817
- $ this ->patchApplierFactoryMock
818
- ],
819
- ]);
822
+ ->willReturnMap (
823
+ [
824
+ [Manager::class, [], $ cacheManager ],
825
+ [\Magento \Framework \App \State::class, [], $ appState ],
826
+ [
827
+ PatchApplierFactory::class,
828
+ ['objectManager ' => $ this ->objectManager ],
829
+ $ this ->patchApplierFactoryMock
830
+ ]
831
+ ]
832
+ );
820
833
$ this ->patchApplierMock ->expects (static ::exactly (2 ))->method ('applySchemaPatch ' )->willReturnMap (
821
834
[
822
835
['Bar_Two ' ],
823
- ['Foo_One ' ],
836
+ ['Foo_One ' ]
824
837
]
825
838
);
826
839
$ this ->patchApplierMock ->expects (static ::exactly (2 ))->method ('applyDataPatch ' )->willReturnMap (
827
840
[
828
841
['Bar_Two ' ],
829
- ['Foo_One ' ],
842
+ ['Foo_One ' ]
830
843
]
831
844
);
832
845
@@ -836,11 +849,11 @@ public function testInstallWithUnresolvableRemoteStorageValidator()
836
849
3 => [SearchConfig::class, $ searchConfigMock ],
837
850
4 => [
838
851
RemoteStorageValidator::class,
839
- new ReflectionException ('Class ' . RemoteStorageValidator::class . ' does not exist ' ),
852
+ new ReflectionException ('Class ' . RemoteStorageValidator::class . ' does not exist ' )
840
853
],
841
854
5 => [\Magento \Framework \App \State::class, $ appState ],
842
855
7 => [Registry::class, $ registry ],
843
- 11 => [Manager::class, $ cacheManager ],
856
+ 11 => [Manager::class, $ cacheManager ]
844
857
];
845
858
$ withArgs = $ willReturnArgs = [];
846
859
@@ -989,10 +1002,12 @@ public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyExcepti
989
1002
990
1003
$ this ->objectManager ->expects (static ::any ())
991
1004
->method ('get ' )
992
- ->willReturnMap ([
993
- [DeclarationInstaller::class, $ this ->declarationInstallerMock ],
994
- [Registry::class, $ registry ]
995
- ]);
1005
+ ->willReturnMap (
1006
+ [
1007
+ [DeclarationInstaller::class, $ this ->declarationInstallerMock ],
1008
+ [Registry::class, $ registry ]
1009
+ ]
1010
+ );
996
1011
997
1012
$ this ->sampleDataState ->expects (static ::never ())->method ('hasError ' );
998
1013
@@ -1051,14 +1066,16 @@ public function testInstallDataFixtures(bool $keepCache, array $expectedToEnable
1051
1066
1052
1067
$ this ->objectManager ->expects ($ this ->atLeastOnce ())
1053
1068
->method ('create ' )
1054
- ->willReturnMap ([
1055
- [Manager::class, [], $ cacheManagerMock ],
1056
- [
1057
- PatchApplierFactory::class,
1058
- ['objectManager ' => $ this ->objectManager ],
1059
- $ this ->patchApplierFactoryMock
1060
- ],
1061
- ]);
1069
+ ->willReturnMap (
1070
+ [
1071
+ [Manager::class, [], $ cacheManagerMock ],
1072
+ [
1073
+ PatchApplierFactory::class,
1074
+ ['objectManager ' => $ this ->objectManager ],
1075
+ $ this ->patchApplierFactoryMock
1076
+ ],
1077
+ ]
1078
+ );
1062
1079
1063
1080
$ registryMock = $ this ->createMock (Registry::class);
1064
1081
$ this ->objectManager ->expects ($ this ->atLeastOnce ())
@@ -1219,10 +1236,12 @@ public function testUninstall(): void
1219
1236
->method ('get ' )
1220
1237
->with (ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTIONS )
1221
1238
->willReturn ([]);
1222
- $ this ->configReader ->expects ($ this ->once ())->method ('getFiles ' )->willReturn ([
1223
- 'ConfigOne.php ' ,
1224
- 'ConfigTwo.php '
1225
- ]);
1239
+ $ this ->configReader ->expects ($ this ->once ())->method ('getFiles ' )->willReturn (
1240
+ [
1241
+ 'ConfigOne.php ' ,
1242
+ 'ConfigTwo.php '
1243
+ ]
1244
+ );
1226
1245
$ configDir = $ this ->getMockForAbstractClass (
1227
1246
WriteInterface::class
1228
1247
);
@@ -1238,9 +1257,11 @@ public function testUninstall(): void
1238
1257
$ this ->filesystem
1239
1258
->expects ($ this ->any ())
1240
1259
->method ('getDirectoryWrite ' )
1241
- ->willReturnMap ([
1242
- [DirectoryList::CONFIG , DriverPool::FILE , $ configDir ],
1243
- ]);
1260
+ ->willReturnMap (
1261
+ [
1262
+ [DirectoryList::CONFIG , DriverPool::FILE , $ configDir ],
1263
+ ]
1264
+ );
1244
1265
$ cacheManager = $ this ->createMock (Manager::class);
1245
1266
$ cacheManager ->expects ($ this ->once ())->method ('getAvailableTypes ' )->willReturn (['foo ' , 'bar ' ]);
1246
1267
$ cacheManager ->expects ($ this ->once ())->method ('clean ' );
@@ -1307,17 +1328,19 @@ private function prepareForUpdateModulesTests()
1307
1328
$ allModules = [
1308
1329
'Foo_One ' => [],
1309
1330
'Bar_Two ' => [],
1310
- 'New_Module ' => [],
1331
+ 'New_Module ' => []
1311
1332
];
1312
1333
1313
1334
$ cacheManager = $ this ->createMock (Manager::class);
1314
1335
$ cacheManager ->expects ($ this ->once ())->method ('getAvailableTypes ' )->willReturn (['foo ' , 'bar ' ]);
1315
1336
$ cacheManager ->expects ($ this ->once ())->method ('clean ' );
1316
1337
$ this ->objectManager ->expects ($ this ->any ())
1317
1338
->method ('get ' )
1318
- ->willReturnMap ([
1319
- [Manager::class, $ cacheManager ]
1320
- ]);
1339
+ ->willReturnMap (
1340
+ [
1341
+ [Manager::class, $ cacheManager ]
1342
+ ]
1343
+ );
1321
1344
$ this ->moduleLoader ->expects ($ this ->once ())->method ('load ' )->willReturn ($ allModules );
1322
1345
1323
1346
$ expectedModules = [
0 commit comments