From ad20dd51b4d00c625aa7462cc9a1672beca19f85 Mon Sep 17 00:00:00 2001 From: Ahmed Alaa <92916738+AhmedAlaa4611@users.noreply.github.com> Date: Sat, 18 Jan 2025 01:00:23 +0200 Subject: [PATCH] fixes the line ending error on windows test (#54236) --- tests/Http/HttpClientTest.php | 5 ++++- tests/View/Blade/BladeComponentsTest.php | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/Http/HttpClientTest.php b/tests/Http/HttpClientTest.php index 334fe3eb947a..64745bf49987 100644 --- a/tests/Http/HttpClientTest.php +++ b/tests/Http/HttpClientTest.php @@ -838,7 +838,10 @@ public function testSequenceBuilder() $this->assertSame(200, $response->status()); $response = $this->factory->get('https://example.com'); - $this->assertSame("This is a story about something that happened long ago when your grandfather was a child.\n", $response->body()); + $this->assertSame( + "This is a story about something that happened long ago when your grandfather was a child.\n", + str_replace("\r\n", "\n", $response->body()) + ); $this->assertSame(200, $response->status()); $response = $this->factory->get('https://example.com'); diff --git a/tests/View/Blade/BladeComponentsTest.php b/tests/View/Blade/BladeComponentsTest.php index 64231b4fd098..92d89e6ef5b9 100644 --- a/tests/View/Blade/BladeComponentsTest.php +++ b/tests/View/Blade/BladeComponentsTest.php @@ -16,12 +16,12 @@ public function testComponentsAreCompiled() public function testClassComponentsAreCompiled() { - $this->assertSame(' + $this->assertSame(str_replace("\r\n", "\n", ' "bar"] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?> withName(\'test\'); ?> shouldRender()): ?> -startComponent($component->resolveView(), $component->data()); ?>', $this->compiler->compileString('@component(\'Illuminate\Tests\View\Blade\ComponentStub::class\', \'test\', ["foo" => "bar"])')); +startComponent($component->resolveView(), $component->data()); ?>'), $this->compiler->compileString('@component(\'Illuminate\Tests\View\Blade\ComponentStub::class\', \'test\', ["foo" => "bar"])')); } public function testEndComponentsAreCompiled() @@ -35,7 +35,7 @@ public function testEndComponentClassesAreCompiled() { $this->compiler->newComponentHash('foo'); - $this->assertSame('renderComponent(); ?> + $this->assertSame(str_replace("\r\n", "\n", 'renderComponent(); ?> @@ -44,7 +44,7 @@ public function testEndComponentClassesAreCompiled() -', $this->compiler->compileString('@endcomponentClass')); +'), $this->compiler->compileString('@endcomponentClass')); } public function testSlotsAreCompiled()