diff --git a/tests/system/Commands/RoutesTest.php b/tests/system/Commands/RoutesTest.php index 6d506274145d..bb89d35bb96d 100644 --- a/tests/system/Commands/RoutesTest.php +++ b/tests/system/Commands/RoutesTest.php @@ -39,7 +39,7 @@ protected function tearDown(): void protected function getBuffer() { - return $this->getStreamFilterBuffer(); + return str_replace(PHP_EOL, "\n", $this->getStreamFilterBuffer()); } private function getCleanRoutes(): RouteCollection diff --git a/tests/system/Commands/Utilities/NamespacesTest.php b/tests/system/Commands/Utilities/NamespacesTest.php index 1b9d15a9e361..26eabd32895f 100644 --- a/tests/system/Commands/Utilities/NamespacesTest.php +++ b/tests/system/Commands/Utilities/NamespacesTest.php @@ -35,9 +35,16 @@ protected function tearDown(): void $this->resetServices(); } + /** + * @see https://regex101.com/r/l3lHfR/1 + */ protected function getBuffer() { - return $this->getStreamFilterBuffer(); + return preg_replace_callback('/(\|\s*[^|]+\s*\|\s*)(.*?)(\s*\|\s*[^|]+\s*\|)/', static function (array $matches) { + $matches[2] = str_replace(DIRECTORY_SEPARATOR, '/', $matches[2]); + + return $matches[1] . $matches[2] . $matches[3]; + }, str_replace(PHP_EOL, "\n", $this->getStreamFilterBuffer())); } public function testNamespacesCommandCodeIgniterOnly()