File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
tests/ChangesReporting/Output Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public function testGetName(): void
3131
3232 public function testReportShouldShowNumberOfChangesWithNoDiffs (): void
3333 {
34- $ this -> expectOsOutputString (( string ) file_get_contents ( __DIR__ . ' /Fixtures/without_diffs.json ' ) );
34+ ob_start ( );
3535
3636 $ this ->jsonOutputFormatter ->report (
3737 new ProcessResult (
@@ -56,15 +56,14 @@ public function testReportShouldShowNumberOfChangesWithNoDiffs(): void
5656 ),
5757 new Configuration (showDiffs: false )
5858 );
59- }
6059
61- protected function expectOsOutputString ( string $ expectedOutput ): void
62- {
63- $ isWindows = strncasecmp ( PHP_OS , ' WIN ' , 3 ) === 0 ;
64- if ( $ isWindows ) {
65- $ expectedOutput = str_replace (' %0A ' , ' %0D%0A ' , $ expectedOutput );
66- }
60+ $ actualOutput = ob_get_clean ();
61+ $ expectedOutput = ( string ) file_get_contents ( __DIR__ . ' /Fixtures/without_diffs.json ' );
62+
63+ // Normalize line endings for comparison
64+ $ actualOutput = str_replace ("\r\n" , "\n" , $ actualOutput );
65+ $ expectedOutput = str_replace ( "\r\n" , "\n" , $ expectedOutput );
6766
68- parent :: expectOutputString ($ expectedOutput );
67+ $ this -> assertSame ($ expectedOutput, $ actualOutput );
6968 }
7069}
You can’t perform that action at this time.
0 commit comments