Skip to content

Commit 53ccc4c

Browse files
committed
Fix text for double component
1 parent 0c8ac28 commit 53ccc4c

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

tests/MiddlewareAndComponentTest.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ public function it_sends_a_simple_request_with_no_response()
6666

6767
Http::assertSent(function ($request) {
6868
return $request['blocks'][0] === [
69-
'id' => 'real_response_id',
70-
'hash' => 'e99681f5450cbaf3774adc5eb74d637f',
71-
'language' => 'php',
72-
'theme' => 'material-theme-palenight',
73-
'code' => 'echo "hello world";',
74-
];
69+
'id' => 'real_response_id',
70+
'hash' => 'e99681f5450cbaf3774adc5eb74d637f',
71+
'language' => 'php',
72+
'theme' => 'material-theme-palenight',
73+
'code' => 'echo "hello world";',
74+
];
7575
});
7676
}
7777

@@ -181,6 +181,14 @@ public function two_components_work()
181181
<code class="torchlight2" style="background-color: #222222;">response 2</code>
182182
EOT;
183183

184-
$this->assertEquals($expected, rtrim($response->content()));
184+
// See https://github.com/laravel/framework/pull/35874/files for reasoning.
185+
$expected = str_replace("\n", '', $expected);
186+
187+
// Covering bugfixes from earlier versions of Laravel
188+
// https://github.com/laravel/framework/pull/35874/files.
189+
$actual = rtrim(str_replace("\n", '', $response->content()));
190+
$actual = str_replace('</code> <code', '</code><code', $actual);
191+
192+
$this->assertEquals($expected, $actual);
185193
}
186194
}

0 commit comments

Comments
 (0)