@@ -41,6 +41,8 @@ protected function setUp(): void
4141 command ('logs:clear --force ' );
4242 $ this ->resetStreamFilterBuffer ();
4343
44+ CLI ::reset ();
45+
4446 $ this ->createDummyLogFiles ();
4547 }
4648
@@ -78,7 +80,7 @@ public function testClearLogsUsingForce(): void
7880
7981 $ this ->assertFileDoesNotExist (WRITEPATH . 'logs ' . DIRECTORY_SEPARATOR . "log- {$ this ->date }.log " );
8082 $ this ->assertFileExists (WRITEPATH . 'logs ' . DIRECTORY_SEPARATOR . 'index.html ' );
81- $ this ->assertSame ("Logs cleared. \n" , preg_replace ('/\e\[[^m]+m/ ' , '' , $ this ->getStreamFilterBuffer ()));
83+ $ this ->assertSame ("\n Logs cleared. \n" , preg_replace ('/\e\[[^m]+m/ ' , '' , $ this ->getStreamFilterBuffer ()));
8284 }
8385
8486 public function testClearLogsAbortsClearWithoutForce (): void
@@ -94,6 +96,7 @@ public function testClearLogsAbortsClearWithoutForce(): void
9496 $ this ->assertFileExists (WRITEPATH . 'logs ' . DIRECTORY_SEPARATOR . "log- {$ this ->date }.log " );
9597 $ this ->assertSame (
9698 <<<'EOT'
99+
97100 Deleting logs aborted.
98101 If you want, use the "--force" option to force delete all log files.
99102
@@ -115,6 +118,7 @@ public function testClearLogsAbortsClearWithoutForceWithDefaultAnswer(): void
115118 $ this ->assertFileExists (WRITEPATH . 'logs ' . DIRECTORY_SEPARATOR . "log- {$ this ->date }.log " );
116119 $ this ->assertSame (
117120 <<<'EOT'
121+
118122 Deleting logs aborted.
119123 If you want, use the "--force" option to force delete all log files.
120124
@@ -134,7 +138,7 @@ public function testClearLogsWithoutForceButWithConfirmation(): void
134138 command ('logs:clear ' );
135139
136140 $ this ->assertFileDoesNotExist (WRITEPATH . 'logs ' . DIRECTORY_SEPARATOR . "log- {$ this ->date }.log " );
137- $ this ->assertSame ("Logs cleared. \n" , preg_replace ('/\e\[[^m]+m/ ' , '' , $ io ->getOutput (2 )));
141+ $ this ->assertSame ("\n Logs cleared. \n" , preg_replace ('/\e\[[^m]+m/ ' , '' , $ io ->getOutput (2 )));
138142 }
139143
140144 #[RequiresOperatingSystem('Darwin|Linux ' )]
@@ -173,6 +177,9 @@ public function testClearLogsFailsOnChmodFailure(): void
173177 }
174178
175179 $ this ->assertFileExists ($ path );
176- $ this ->assertSame ("Error in deleting the logs files. \n" , preg_replace ('/\e\[[^m]+m/ ' , '' , $ this ->getStreamFilterBuffer ()));
180+ $ this ->assertSame (
181+ "\nError in deleting the logs files. \n" ,
182+ preg_replace ('/\e\[[^m]+m/ ' , '' , $ this ->getStreamFilterBuffer ()),
183+ );
177184 }
178185}
0 commit comments