@@ -318,10 +318,11 @@ private function createObject($connectionFactory = false, $objectManagerProvider
318
318
/**
319
319
* @param array $request
320
320
* @param array $logMessages
321
+ * @param array $logMetaMessages
321
322
* @dataProvider installDataProvider
322
323
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
323
324
*/
324
- public function testInstall (array $ request , array $ logMessages )
325
+ public function testInstall (array $ request , array $ logMessages, array $ logMetaMessages )
325
326
{
326
327
$ this ->moduleList ->method ('getOne ' )
327
328
->willReturnMap (
@@ -452,6 +453,13 @@ public function testInstall(array $request, array $logMessages)
452
453
],
453
454
$ logMessages
454
455
);
456
+ call_user_func_array (
457
+ [
458
+ $ this ->logger ->expects ($ this ->exactly (count ($ logMetaMessages )))->method ('logMeta ' ),
459
+ 'withConsecutive '
460
+ ],
461
+ $ logMetaMessages
462
+ );
455
463
$ this ->logger ->expects ($ this ->exactly (3 ))
456
464
->method ('logSuccess ' )
457
465
->withConsecutive (
@@ -502,6 +510,37 @@ public function installDataProvider()
502
510
['Write installation date... ' ],
503
511
['Sample Data is installed with errors. See log file for details ' ]
504
512
],
513
+ 'logMetaMessages ' => [
514
+ ['Starting Magento installation: ' ],
515
+ ['[Progress: 1 / 22] ' ],
516
+ ['[Progress: 2 / 22] ' ],
517
+ ['[Progress: 3 / 22] ' ],
518
+ ['[Progress: 4 / 22] ' ],
519
+ ['Schema creation/updates: ' ],
520
+ ['[Progress: 5 / 22] ' ],
521
+ ['[Progress: 6 / 22] ' ],
522
+ ['Schema post-updates: ' ],
523
+ ['[Progress: 7 / 22] ' ],
524
+ ['[Progress: 8 / 22] ' ],
525
+ ['[Progress: 9 / 22] ' ],
526
+ ['[Progress: 10 / 22] ' ],
527
+ ['[Progress: 11 / 22] ' ],
528
+ ['[Progress: 12 / 22] ' ],
529
+ ['[Progress: 13 / 22] ' ],
530
+ ['Data install/update: ' ],
531
+ ['Disabling caches: ' ],
532
+ ['[Progress: 14 / 22] ' ],
533
+ ['[Progress: 15 / 22] ' ],
534
+ ['Data post-updates: ' ],
535
+ ['[Progress: 16 / 22] ' ],
536
+ ['[Progress: 17 / 22] ' ],
537
+ ['Enabling caches: ' ],
538
+ ['[Progress: 18 / 22] ' ],
539
+ ['[Progress: 19 / 22] ' ],
540
+ ['[Progress: 20 / 22] ' ],
541
+ ['[Progress: 21 / 22] ' ],
542
+ ['[Progress: 22 / 22] ' ],
543
+ ],
505
544
],
506
545
[
507
546
'request ' => [
@@ -547,6 +586,38 @@ public function installDataProvider()
547
586
['Write installation date... ' ],
548
587
['Sample Data is installed with errors. See log file for details ' ]
549
588
],
589
+ 'logMetaMessages ' => [
590
+ ['Starting Magento installation: ' ],
591
+ ['[Progress: 1 / 23] ' ],
592
+ ['[Progress: 2 / 23] ' ],
593
+ ['[Progress: 3 / 23] ' ],
594
+ ['[Progress: 4 / 23] ' ],
595
+ ['Schema creation/updates: ' ],
596
+ ['[Progress: 5 / 23] ' ],
597
+ ['[Progress: 6 / 23] ' ],
598
+ ['Schema post-updates: ' ],
599
+ ['[Progress: 7 / 23] ' ],
600
+ ['[Progress: 8 / 23] ' ],
601
+ ['[Progress: 9 / 23] ' ],
602
+ ['[Progress: 10 / 23] ' ],
603
+ ['[Progress: 11 / 23] ' ],
604
+ ['[Progress: 12 / 23] ' ],
605
+ ['[Progress: 13 / 23] ' ],
606
+ ['Data install/update: ' ],
607
+ ['Disabling caches: ' ],
608
+ ['[Progress: 14 / 23] ' ],
609
+ ['[Progress: 15 / 23] ' ],
610
+ ['Data post-updates: ' ],
611
+ ['[Progress: 16 / 23] ' ],
612
+ ['[Progress: 17 / 23] ' ],
613
+ ['Enabling caches: ' ],
614
+ ['[Progress: 18 / 23] ' ],
615
+ ['[Progress: 19 / 23] ' ],
616
+ ['[Progress: 20 / 23] ' ],
617
+ ['[Progress: 21 / 23] ' ],
618
+ ['[Progress: 22 / 23] ' ],
619
+ ['[Progress: 23 / 23] ' ],
620
+ ],
550
621
],
551
622
];
552
623
}
@@ -556,13 +627,14 @@ public function installDataProvider()
556
627
*
557
628
* @param array $request
558
629
* @param array $logMessages
630
+ * @param array $logMetaMessages
559
631
* @throws RuntimeException
560
632
* @throws FileSystemException
561
633
* @throws LocalizedException
562
634
* @dataProvider installWithOrderIncrementPrefixDataProvider
563
635
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
564
636
*/
565
- public function testInstallWithOrderIncrementPrefix (array $ request , array $ logMessages )
637
+ public function testInstallWithOrderIncrementPrefix (array $ request , array $ logMessages, array $ logMetaMessages )
566
638
{
567
639
$ this ->moduleList ->method ('getOne ' )
568
640
->willReturnMap (
@@ -706,9 +778,17 @@ public function testInstallWithOrderIncrementPrefix(array $request, array $logMe
706
778
],
707
779
$ logMessages
708
780
);
709
- $ this ->logger ->expects ($ this ->exactly (2 ))
781
+ call_user_func_array (
782
+ [
783
+ $ this ->logger ->expects ($ this ->exactly (count ($ logMetaMessages )))->method ('logMeta ' ),
784
+ 'withConsecutive '
785
+ ],
786
+ $ logMetaMessages
787
+ );
788
+ $ this ->logger ->expects ($ this ->exactly (3 ))
710
789
->method ('logSuccess ' )
711
790
->withConsecutive (
791
+ ['Cache cleared successfully ' ],
712
792
['Magento installation complete. ' ],
713
793
['Magento Admin URI: / ' ]
714
794
);
@@ -733,16 +813,13 @@ public function installWithOrderIncrementPrefixDataProvider(): array
733
813
InstallCommand::INPUT_KEY_SALES_ORDER_INCREMENT_PREFIX => 'ORD '
734
814
],
735
815
'logMessages ' => [
736
- ['Starting Magento installation: ' ],
737
816
['File permissions check... ' ],
738
817
['Required extensions check... ' ],
739
818
['Enabling Maintenance Mode... ' ],
740
819
['Installing deployment configuration... ' ],
741
820
['Installing database schema: ' ],
742
- ['Schema creation/updates: ' ],
743
821
['Module \'Foo_One \': ' ],
744
822
['Module \'Bar_Two \': ' ],
745
- ['Schema post-updates: ' ],
746
823
['Module \'Foo_One \': ' ],
747
824
['Module \'Bar_Two \': ' ],
748
825
['Installing search configuration... ' ],
@@ -753,24 +830,51 @@ public function installWithOrderIncrementPrefixDataProvider(): array
753
830
['foo: 1 ' ],
754
831
['bar: 1 ' ],
755
832
['Installing data... ' ],
756
- ['Data install/update: ' ],
757
- ['Disabling caches: ' ],
758
833
['Current status: ' ],
759
834
['Module \'Foo_One \': ' ],
760
835
['Module \'Bar_Two \': ' ],
761
- ['Data post-updates: ' ],
762
836
['Module \'Foo_One \': ' ],
763
837
['Module \'Bar_Two \': ' ],
764
- ['Enabling caches: ' ],
765
838
['Current status: ' ],
766
839
['Creating sales order increment prefix... ' ], // << added
767
840
['Caches clearing: ' ],
768
- ['Cache cleared successfully ' ],
769
841
['Disabling Maintenance Mode: ' ],
770
842
['Post installation file permissions check... ' ],
771
843
['Write installation date... ' ],
772
844
['Sample Data is installed with errors. See log file for details ' ]
773
845
],
846
+ 'logMetaMessages ' => [
847
+ ['Starting Magento installation: ' ],
848
+ ['[Progress: 1 / 23] ' ],
849
+ ['[Progress: 2 / 23] ' ],
850
+ ['[Progress: 3 / 23] ' ],
851
+ ['[Progress: 4 / 23] ' ],
852
+ ['Schema creation/updates: ' ],
853
+ ['[Progress: 5 / 23] ' ],
854
+ ['[Progress: 6 / 23] ' ],
855
+ ['Schema post-updates: ' ],
856
+ ['[Progress: 7 / 23] ' ],
857
+ ['[Progress: 8 / 23] ' ],
858
+ ['[Progress: 9 / 23] ' ],
859
+ ['[Progress: 10 / 23] ' ],
860
+ ['[Progress: 11 / 23] ' ],
861
+ ['[Progress: 12 / 23] ' ],
862
+ ['[Progress: 13 / 23] ' ],
863
+ ['Data install/update: ' ],
864
+ ['Disabling caches: ' ],
865
+ ['[Progress: 14 / 23] ' ],
866
+ ['[Progress: 15 / 23] ' ],
867
+ ['Data post-updates: ' ],
868
+ ['[Progress: 16 / 23] ' ],
869
+ ['[Progress: 17 / 23] ' ],
870
+ ['Enabling caches: ' ],
871
+ ['[Progress: 18 / 23] ' ],
872
+ ['[Progress: 19 / 23] ' ],
873
+ ['[Progress: 20 / 23] ' ],
874
+ ['[Progress: 21 / 23] ' ],
875
+ ['[Progress: 22 / 23] ' ],
876
+ ['[Progress: 23 / 23] ' ],
877
+ ],
774
878
],
775
879
];
776
880
}
@@ -798,7 +902,6 @@ public function testInstallWithInvalidRemoteStorageConfiguration(bool $isDeploym
798
902
['Installing database schema: ' ],
799
903
['Module \'Foo_One \': ' ],
800
904
['Module \'Bar_Two \': ' ],
801
- ['Schema post-updates: ' ],
802
905
['Module \'Foo_One \': ' ],
803
906
['Module \'Bar_Two \': ' ],
804
907
['Installing search configuration... ' ],
@@ -807,7 +910,18 @@ public function testInstallWithInvalidRemoteStorageConfiguration(bool $isDeploym
807
910
808
911
$ logMetaMessages = [
809
912
['Starting Magento installation: ' ],
913
+ ['[Progress: 1 / 22] ' ],
914
+ ['[Progress: 2 / 22] ' ],
915
+ ['[Progress: 3 / 22] ' ],
916
+ ['[Progress: 4 / 22] ' ],
810
917
['Schema creation/updates: ' ],
918
+ ['[Progress: 5 / 22] ' ],
919
+ ['[Progress: 6 / 22] ' ],
920
+ ['Schema post-updates: ' ],
921
+ ['[Progress: 7 / 22] ' ],
922
+ ['[Progress: 8 / 22] ' ],
923
+ ['[Progress: 9 / 22] ' ],
924
+ ['[Progress: 10 / 22] ' ],
811
925
];
812
926
813
927
$ this ->config ->expects (static ::atLeastOnce ())
@@ -988,6 +1102,7 @@ public function testInstallWithUnresolvableRemoteStorageValidator()
988
1102
989
1103
// every log message call is expected
990
1104
$ logMessages = $ this ->installDataProvider ()[0 ]['logMessages ' ];
1105
+ $ logMetaMessages = $ this ->installDataProvider ()[0 ]['logMetaMessages ' ];
991
1106
992
1107
$ this ->config ->expects (static ::atLeastOnce ())
993
1108
->method ('get ' )
@@ -1145,9 +1260,17 @@ public function testInstallWithUnresolvableRemoteStorageValidator()
1145
1260
],
1146
1261
$ logMessages
1147
1262
);
1148
- $ this ->logger ->expects (static ::exactly (2 ))
1263
+ call_user_func_array (
1264
+ [
1265
+ $ this ->logger ->expects (static ::exactly (count ($ logMetaMessages )))->method ('logMeta ' ),
1266
+ 'withConsecutive '
1267
+ ],
1268
+ $ logMetaMessages
1269
+ );
1270
+ $ this ->logger ->expects (static ::exactly (3 ))
1149
1271
->method ('logSuccess ' )
1150
1272
->withConsecutive (
1273
+ ['Cache cleared successfully ' ],
1151
1274
['Magento installation complete. ' ],
1152
1275
['Magento Admin URI: / ' ]
1153
1276
);
@@ -1179,7 +1302,11 @@ public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyExcepti
1179
1302
1180
1303
$ logMetaMessages = [
1181
1304
['Starting Magento installation: ' ],
1182
- ['Schema creation/updates: ' ]
1305
+ ['[Progress: 1 / 22] ' ],
1306
+ ['[Progress: 2 / 22] ' ],
1307
+ ['[Progress: 3 / 22] ' ],
1308
+ ['[Progress: 4 / 22] ' ],
1309
+ ['Schema creation/updates: ' ],
1183
1310
];
1184
1311
1185
1312
$ this ->config ->expects (static ::atLeastOnce ())
@@ -1468,17 +1595,20 @@ public function testUpdateModulesSequence()
1468
1595
$ this ->logger
1469
1596
->method ('log ' )
1470
1597
->withConsecutive (
1471
- ['Cache types config flushed successfully ' ],
1472
- ['Cache cleared successfully ' ],
1473
1598
['The directory \'/generation \' doesn \'t exist - skipping cleanup ' ],
1474
1599
);
1475
-
1476
1600
$ this ->logger
1477
1601
->method ('logMeta ' )
1478
1602
->withConsecutive (
1479
1603
['File system cleanup: ' ],
1480
1604
['Updating modules: ' ]
1481
1605
);
1606
+ $ this ->logger
1607
+ ->method ('logSuccess ' )
1608
+ ->withConsecutive (
1609
+ ['Cache types config flushed successfully ' ],
1610
+ ['Cache cleared successfully ' ],
1611
+ );
1482
1612
1483
1613
$ installer ->updateModulesSequence (false );
1484
1614
}
@@ -1489,12 +1619,11 @@ public function testUpdateModulesSequenceKeepGenerated()
1489
1619
1490
1620
$ installer = $ this ->prepareForUpdateModulesTests ();
1491
1621
$ this ->logger
1492
- ->method ('log ' )
1622
+ ->method ('logSuccess ' )
1493
1623
->withConsecutive (
1494
1624
['Cache types config flushed successfully ' ],
1495
1625
['Cache cleared successfully ' ],
1496
1626
);
1497
-
1498
1627
$ this ->logger
1499
1628
->method ('logMeta ' )
1500
1629
->withConsecutive (
@@ -1546,7 +1675,6 @@ public function testUninstall(): void
1546
1675
->method ('get ' )
1547
1676
->with (Manager::class)
1548
1677
->willReturn ($ cacheManager );
1549
- $ this ->logger ->expects ($ this ->once ())->method ('logSuccess ' )->with ('Magento uninstallation complete. ' );
1550
1678
$ this ->cleanupFiles ->expects ($ this ->once ())->method ('clearAllFiles ' )->willReturn (
1551
1679
[
1552
1680
"The directory '/var' doesn't exist - skipping cleanup " ,
@@ -1563,18 +1691,17 @@ public function testUninstall(): void
1563
1691
["The file '/config/ConfigOne.php' doesn't exist - skipping cleanup " ],
1564
1692
["The file '/config/ConfigTwo.php' doesn't exist - skipping cleanup " ]
1565
1693
);
1566
-
1567
1694
$ this ->logger
1568
1695
->method ('logMeta ' )
1569
1696
->withConsecutive (
1570
1697
['Starting Magento uninstallation: ' ],
1571
1698
['File system cleanup: ' ],
1572
1699
);
1573
-
1574
1700
$ this ->logger
1575
1701
->method ('logSuccess ' )
1576
1702
->withConsecutive (
1577
1703
['Cache cleared successfully ' ],
1704
+ ['Magento uninstallation complete. ' ],
1578
1705
);
1579
1706
1580
1707
$ this ->object ->uninstall ();
0 commit comments