diff --git a/.editorconfig b/.editorconfig index dcc5687..19ae126 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,3 +8,6 @@ charset = utf-8 [*.md] indent_size = 2 + +[tests/views/*.php] +insert_final_newline = false diff --git a/tests/FlightTest.php b/tests/FlightTest.php index 0c9a7d7..b4b32ce 100644 --- a/tests/FlightTest.php +++ b/tests/FlightTest.php @@ -396,15 +396,11 @@ class FlightTest extends TestCase $html = <<<'html'
Hi
Hi
- - - html; - // if windows replace \n with \r\n - $html = str_replace(["\n", "\r\n"], PHP_EOL, $html); + $html = str_replace(["\n", "\r\n"], '', $html); $this->expectOutputString($html); diff --git a/tests/ViewTest.php b/tests/ViewTest.php index cf300c9..c0b0c5c 100644 --- a/tests/ViewTest.php +++ b/tests/ViewTest.php @@ -178,15 +178,12 @@ class ViewTest extends TestCase $html = <<<'html'
Hi
Hi
- - - html; // if windows replace \n with \r\n - $html = str_replace("\n", PHP_EOL, $html); + $html = str_replace(["\n", "\r"], '', $html); $this->expectOutputString($html); @@ -205,11 +202,9 @@ class ViewTest extends TestCase $html = <<<'html'
qux
bar
- html; - // if windows replace \n with \r\n - $html = str_replace("\n", PHP_EOL, $html); + $html = str_replace(["\n", "\r"], '', $html); $this->expectOutputString($html); @@ -222,19 +217,15 @@ class ViewTest extends TestCase $html1 = <<<'html'
Hi
- html; $html2 = <<<'html' - - - html; - $html1 = str_replace(["\n", "\r\n"], PHP_EOL, $html1); - $html2 = str_replace(["\n", "\r\n"], PHP_EOL, $html2); + $html1 = str_replace(["\n", "\r"], '', $html1); + $html2 = str_replace(["\n", "\r"], '', $html2); return [ [ diff --git a/tests/commands/RouteCommandTest.php b/tests/commands/RouteCommandTest.php index e973891..31f7009 100644 --- a/tests/commands/RouteCommandTest.php +++ b/tests/commands/RouteCommandTest.php @@ -131,10 +131,18 @@ PHP; $app->handle(['runway', 'routes', '--post']); $this->assertStringContainsString('Routes', file_get_contents(static::$ou)); - $this->assertStringContainsString('+---------+---------+-------+----------+------------+ -| Pattern | Methods | Alias | Streamed | Middleware | -+---------+---------+-------+----------+------------+ -| /post | POST | | No | Closure | -+---------+---------+-------+----------+------------+', $this->removeColors(file_get_contents(static::$ou))); + + $expected = <<<'output' + +---------+---------+-------+----------+------------+ + | Pattern | Methods | Alias | Streamed | Middleware | + +---------+---------+-------+----------+------------+ + | /post | POST | | No | Closure | + +---------+---------+-------+----------+------------+ + output; + + $this->assertStringContainsString( + $expected, + $this->removeColors(file_get_contents(static::$ou)) + ); } } diff --git a/tests/views/input.php b/tests/views/input.php index 19e7182..4226ea0 100644 --- a/tests/views/input.php +++ b/tests/views/input.php @@ -1,7 +1 @@ - - - + \ No newline at end of file diff --git a/tests/views/myComponent.php b/tests/views/myComponent.php index cf0a36f..80e571d 100644 --- a/tests/views/myComponent.php +++ b/tests/views/myComponent.php @@ -1 +1 @@ -
+
\ No newline at end of file