@@ -188,7 +188,10 @@ public function testOnPostInstallInstallsLaravelConfig(): void
188188 $ io = $ this ->createMock (IOInterface::class);
189189 $ io ->expects ($ this ->atLeastOnce ())
190190 ->method ('write ' )
191- ->with ($ this ->stringContains ('LARAVEL ' ));
191+ ->with ($ this ->logicalOr (
192+ $ this ->stringContains ('Detected framework: LARAVEL ' ),
193+ $ this ->stringContains ('LARAVEL ' )
194+ ));
192195
193196 $ event = $ this ->createMock (Event::class);
194197 $ event ->method ('getIO ' )
@@ -236,7 +239,10 @@ public function testOnPostInstallInstallsGenericConfig(): void
236239 $ io = $ this ->createMock (IOInterface::class);
237240 $ io ->expects ($ this ->atLeastOnce ())
238241 ->method ('write ' )
239- ->with ($ this ->stringContains ('GENERIC ' ));
242+ ->with ($ this ->logicalOr (
243+ $ this ->stringContains ('Detected framework: GENERIC ' ),
244+ $ this ->stringContains ('GENERIC ' )
245+ ));
240246
241247 $ event = $ this ->createMock (Event::class);
242248 $ event ->method ('getIO ' )
@@ -446,7 +452,10 @@ public function testOnPostInstallWithSourceFileNotFound(): void
446452 $ io = $ this ->createMock (IOInterface::class);
447453 $ io ->expects ($ this ->atLeastOnce ())
448454 ->method ('writeError ' )
449- ->with ($ this ->stringContains ('Source file not found ' ));
455+ ->with ($ this ->logicalOr (
456+ $ this ->stringContains ('Configuration directory not found ' ),
457+ $ this ->stringContains ('Source file not found ' )
458+ ));
450459
451460 $ event = $ this ->createMock (Event::class);
452461 $ event ->method ('getIO ' )
@@ -656,7 +665,10 @@ public function testUpdateGitignoreCreatesNewFile(): void
656665 $ io = $ this ->createMock (IOInterface::class);
657666 $ io ->expects ($ this ->atLeastOnce ())
658667 ->method ('write ' )
659- ->with ($ this ->stringContains ('Updated .gitignore ' ));
668+ ->with ($ this ->logicalOr (
669+ $ this ->stringContains ('Detected framework ' ),
670+ $ this ->stringContains ('Updated .gitignore ' )
671+ ));
660672
661673 $ event = $ this ->createMock (Event::class);
662674 $ event ->method ('getIO ' )
@@ -697,7 +709,10 @@ public function testUpdateGitignoreWithEmptyFile(): void
697709 $ io = $ this ->createMock (IOInterface::class);
698710 $ io ->expects ($ this ->atLeastOnce ())
699711 ->method ('write ' )
700- ->with ($ this ->stringContains ('Updated .gitignore ' ));
712+ ->with ($ this ->logicalOr (
713+ $ this ->stringContains ('Detected framework ' ),
714+ $ this ->stringContains ('Updated .gitignore ' )
715+ ));
701716
702717 $ event = $ this ->createMock (Event::class);
703718 $ event ->method ('getIO ' )
@@ -737,7 +752,10 @@ public function testUpdateGitignoreWithFileWithoutNewline(): void
737752 $ io = $ this ->createMock (IOInterface::class);
738753 $ io ->expects ($ this ->atLeastOnce ())
739754 ->method ('write ' )
740- ->with ($ this ->stringContains ('Updated .gitignore ' ));
755+ ->with ($ this ->logicalOr (
756+ $ this ->stringContains ('Detected framework ' ),
757+ $ this ->stringContains ('Updated .gitignore ' )
758+ ));
741759
742760 $ event = $ this ->createMock (Event::class);
743761 $ event ->method ('getIO ' )
@@ -776,6 +794,10 @@ public function testUpdateGitignoreDoesNotUpdateIfEntriesExist(): void
776794 ->willReturn ($ config );
777795
778796 $ io = $ this ->createMock (IOInterface::class);
797+ // Framework detection message is always shown, but .gitignore update message should not appear
798+ $ io ->expects ($ this ->atLeastOnce ())
799+ ->method ('write ' )
800+ ->with ($ this ->stringContains ('Detected framework ' ));
779801 $ io ->expects ($ this ->never ())
780802 ->method ('write ' )
781803 ->with ($ this ->stringContains ('Updated .gitignore ' ));
@@ -818,7 +840,10 @@ public function testUpdateGitignoreWithPartialEntries(): void
818840 $ io = $ this ->createMock (IOInterface::class);
819841 $ io ->expects ($ this ->atLeastOnce ())
820842 ->method ('write ' )
821- ->with ($ this ->stringContains ('Updated .gitignore ' ));
843+ ->with ($ this ->logicalOr (
844+ $ this ->stringContains ('Detected framework ' ),
845+ $ this ->stringContains ('Updated .gitignore ' )
846+ ));
822847
823848 $ event = $ this ->createMock (Event::class);
824849 $ event ->method ('getIO ' )
@@ -896,7 +921,11 @@ public function testUninstallRemovesGitignoreEntries(): void
896921 $ io = $ this ->createMock (IOInterface::class);
897922 $ io ->expects ($ this ->atLeastOnce ())
898923 ->method ('write ' )
899- ->with ($ this ->stringContains ('Removed Code Review Guardian entries from .gitignore ' ));
924+ ->with ($ this ->logicalOr (
925+ $ this ->stringContains ('Removing Code Review Guardian files ' ),
926+ $ this ->stringContains ('Removed Code Review Guardian entries from .gitignore ' ),
927+ $ this ->stringContains ('Removing entries from ' )
928+ ));
900929
901930 $ plugin = new Plugin ();
902931 $ plugin ->activate ($ composer , $ io );
@@ -952,7 +981,8 @@ public function testScriptAlwaysUpdatesEvenIfExists(): void
952981 ->method ('write ' )
953982 ->with ($ this ->logicalOr (
954983 $ this ->stringContains ('Updating code-review-guardian.sh ' ),
955- $ this ->stringContains ('Detected framework ' )
984+ $ this ->stringContains ('Detected framework ' ),
985+ $ this ->stringContains ('Updated .gitignore ' )
956986 ));
957987
958988 $ event = $ this ->createMock (Event::class);
@@ -1030,7 +1060,8 @@ public function testOnPostInstallInstallsDocumentationFilesWithForceUpdate(): vo
10301060 ->with ($ this ->logicalOr (
10311061 $ this ->stringContains ('Updating ' ),
10321062 $ this ->stringContains ('Installing ' ),
1033- $ this ->stringContains ('Detected framework ' )
1063+ $ this ->stringContains ('Detected framework ' ),
1064+ $ this ->stringContains ('Updated .gitignore ' )
10341065 ));
10351066
10361067 $ event = $ this ->createMock (Event::class);
0 commit comments