@@ -394,9 +394,9 @@ public function testInstall(array $request, array $logMessages)
394
394
$ dataSetup ->expects ($ this ->any ())->method ('getConnection ' )->willReturn ($ connection );
395
395
$ cacheManager = $ this ->createMock (Manager::class);
396
396
$ cacheManager ->expects ($ this ->any ())->method ('getAvailableTypes ' )->willReturn (['foo ' , 'bar ' ]);
397
- $ cacheManager ->expects ($ this ->exactly ( 3 ))->method ('setEnabled ' )->willReturn (['foo ' , 'bar ' ]);
398
- $ cacheManager ->expects ($ this ->exactly (3 ))->method ('clean ' );
399
- $ cacheManager ->expects ($ this ->exactly ( 3 ))->method ('getStatus ' )->willReturn (['foo ' => 1 , 'bar ' => 1 ]);
397
+ $ cacheManager ->expects ($ this ->once ( ))->method ('setEnabled ' )->willReturn (['foo ' , 'bar ' ]);
398
+ $ cacheManager ->expects ($ this ->exactly (2 ))->method ('clean ' );
399
+ $ cacheManager ->expects ($ this ->once ( ))->method ('getStatus ' )->willReturn (['foo ' => 1 , 'bar ' => 1 ]);
400
400
$ appState = $ this ->getMockBuilder (\Magento \Framework \App \State::class)
401
401
->disableOriginalConstructor ()
402
402
->disableArgumentCloning ()
@@ -524,15 +524,11 @@ public function installDataProvider()
524
524
['bar: 1 ' ],
525
525
['Installing data... ' ],
526
526
['Data install/update: ' ],
527
- ['Disabling caches: ' ],
528
- ['Current status: ' ],
529
527
['Module \'Foo_One \': ' ],
530
528
['Module \'Bar_Two \': ' ],
531
529
['Data post-updates: ' ],
532
530
['Module \'Foo_One \': ' ],
533
531
['Module \'Bar_Two \': ' ],
534
- ['Enabling caches: ' ],
535
- ['Current status: ' ],
536
532
['Caches clearing: ' ],
537
533
['Cache cleared successfully ' ],
538
534
['Disabling Maintenance Mode: ' ],
@@ -578,15 +574,11 @@ public function installDataProvider()
578
574
['bar: 1 ' ],
579
575
['Installing data... ' ],
580
576
['Data install/update: ' ],
581
- ['Disabling caches: ' ],
582
- ['Current status: ' ],
583
577
['Module \'Foo_One \': ' ],
584
578
['Module \'Bar_Two \': ' ],
585
579
['Data post-updates: ' ],
586
580
['Module \'Foo_One \': ' ],
587
581
['Module \'Bar_Two \': ' ],
588
- ['Enabling caches: ' ],
589
- ['Current status: ' ],
590
582
['Installing admin user... ' ],
591
583
['Caches clearing: ' ],
592
584
['Cache cleared successfully ' ],
@@ -678,9 +670,9 @@ public function testInstallWithOrderIncrementPrefix(array $request, array $logMe
678
670
$ dataSetup ->expects ($ this ->any ())->method ('getConnection ' )->willReturn ($ connection );
679
671
$ cacheManager = $ this ->createMock (Manager::class);
680
672
$ cacheManager ->expects ($ this ->any ())->method ('getAvailableTypes ' )->willReturn (['foo ' , 'bar ' ]);
681
- $ cacheManager ->expects ($ this ->exactly ( 3 ))->method ('setEnabled ' )->willReturn (['foo ' , 'bar ' ]);
682
- $ cacheManager ->expects ($ this ->exactly (3 ))->method ('clean ' );
683
- $ cacheManager ->expects ($ this ->exactly ( 3 ))->method ('getStatus ' )->willReturn (['foo ' => 1 , 'bar ' => 1 ]);
673
+ $ cacheManager ->expects ($ this ->once ( ))->method ('setEnabled ' )->willReturn (['foo ' , 'bar ' ]);
674
+ $ cacheManager ->expects ($ this ->exactly (2 ))->method ('clean ' );
675
+ $ cacheManager ->expects ($ this ->once ( ))->method ('getStatus ' )->willReturn (['foo ' => 1 , 'bar ' => 1 ]);
684
676
$ appState = $ this ->getMockBuilder (\Magento \Framework \App \State::class)
685
677
->disableOriginalConstructor ()
686
678
->disableArgumentCloning ()
@@ -815,15 +807,11 @@ public function installWithOrderIncrementPrefixDataProvider(): array
815
807
['bar: 1 ' ],
816
808
['Installing data... ' ],
817
809
['Data install/update: ' ],
818
- ['Disabling caches: ' ],
819
- ['Current status: ' ],
820
810
['Module \'Foo_One \': ' ],
821
811
['Module \'Bar_Two \': ' ],
822
812
['Data post-updates: ' ],
823
813
['Module \'Foo_One \': ' ],
824
814
['Module \'Bar_Two \': ' ],
825
- ['Enabling caches: ' ],
826
- ['Current status: ' ],
827
815
['Creating sales order increment prefix... ' ], // << added
828
816
['Caches clearing: ' ],
829
817
['Cache cleared successfully ' ],
@@ -1078,9 +1066,9 @@ public function testInstallWithUnresolvableRemoteStorageValidator()
1078
1066
$ dataSetup ->expects (static ::any ())->method ('getConnection ' )->willReturn ($ connection );
1079
1067
$ cacheManager = $ this ->createMock (Manager::class);
1080
1068
$ cacheManager ->expects (static ::any ())->method ('getAvailableTypes ' )->willReturn (['foo ' , 'bar ' ]);
1081
- $ cacheManager ->expects (static ::exactly ( 3 ))->method ('setEnabled ' )->willReturn (['foo ' , 'bar ' ]);
1082
- $ cacheManager ->expects (static ::exactly (3 ))->method ('clean ' );
1083
- $ cacheManager ->expects (static ::exactly ( 3 ))->method ('getStatus ' )->willReturn (['foo ' => 1 , 'bar ' => 1 ]);
1069
+ $ cacheManager ->expects (static ::once ( ))->method ('setEnabled ' )->willReturn (['foo ' , 'bar ' ]);
1070
+ $ cacheManager ->expects (static ::exactly (2 ))->method ('clean ' );
1071
+ $ cacheManager ->expects (static ::once ( ))->method ('getStatus ' )->willReturn (['foo ' => 1 , 'bar ' => 1 ]);
1084
1072
$ appState = $ this ->getMockBuilder (\Magento \Framework \App \State::class)
1085
1073
->disableOriginalConstructor ()
1086
1074
->disableArgumentCloning ()
@@ -1362,28 +1350,13 @@ public function installWithInvalidRemoteStorageConfigurationWithEarlyExceptionDa
1362
1350
/**
1363
1351
* Test for InstallDataFixtures
1364
1352
*
1365
- * @dataProvider testInstallDataFixturesDataProvider
1366
- *
1367
- * @param bool $keepCache
1368
- * @param array $expectedToEnableCacheTypes
1369
1353
* @return void
1370
1354
*/
1371
- public function testInstallDataFixtures (bool $ keepCache , array $ expectedToEnableCacheTypes ): void
1355
+ public function testInstallDataFixtures (): void
1372
1356
{
1373
1357
$ this ->moduleList ->method ('getOne ' )->willReturn (['setup_version ' => '2.0.0 ' ]);
1374
1358
1375
1359
$ cacheManagerMock = $ this ->createMock (Manager::class);
1376
- //simulate disabled layout cache type
1377
- $ cacheManagerMock ->expects ($ this ->atLeastOnce ())
1378
- ->method ('getStatus ' )
1379
- ->willReturn (['layout ' => 0 ]);
1380
- $ cacheManagerMock ->expects ($ this ->atLeastOnce ())
1381
- ->method ('getAvailableTypes ' )
1382
- ->willReturn (['block_html ' , 'full_page ' , 'layout ' , 'config ' , 'collections ' ]);
1383
- $ cacheManagerMock ->expects ($ this ->exactly (2 ))
1384
- ->method ('setEnabled ' )
1385
- ->withConsecutive ([$ expectedToEnableCacheTypes , false ], [$ expectedToEnableCacheTypes , true ])
1386
- ->willReturn ([]);
1387
1360
1388
1361
$ this ->objectManager ->expects ($ this ->atLeastOnce ())
1389
1362
->method ('create ' )
@@ -1437,25 +1410,7 @@ public function testInstallDataFixtures(bool $keepCache, array $expectedToEnable
1437
1410
->method ('create ' )
1438
1411
->willReturn ($ dataSetup );
1439
1412
1440
- $ this ->object ->installDataFixtures ($ this ->request , $ keepCache );
1441
- }
1442
-
1443
- /**
1444
- * DataProvider for testInstallDataFixtures
1445
- *
1446
- * @return array
1447
- */
1448
- public function testInstallDataFixturesDataProvider (): array
1449
- {
1450
- return [
1451
- 'keep cache ' => [
1452
- true , ['block_html ' , 'full_page ' ]
1453
- ],
1454
- 'do not keep a cache ' => [
1455
- false ,
1456
- ['block_html ' , 'full_page ' , 'layout ' ]
1457
- ],
1458
- ];
1413
+ $ this ->object ->installDataFixtures ($ this ->request );
1459
1414
}
1460
1415
1461
1416
public function testCheckInstallationFilePermissions ()
0 commit comments