/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Integration/Http/ResponseTest.php
31 строка
837 B
Lucas Michot
[13.x] Simplify most of the exceptions expectations (#61049)
05 авг 2026, 18:34
Не верифицирован
05 авг 2026, 18:34
910cd94
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Integration\Http; use Illuminate\Http\Response; use Illuminate\Support\Facades\Route; use InvalidArgumentException; use JsonSerializable; use Orchestra\Testbench\TestCase; class ResponseTest extends TestCase { public function testResponseWithInvalidJsonThrowsException() { $this->expectExceptionObject(new InvalidArgumentException('Malformed UTF-8 characters, possibly incorrectly encoded')); Route::get('/response', function () { return (new Response())->setContent(new class implements JsonSerializable { public function jsonSerialize(): string { return "\xB1\x31"; } }); }); $this->withoutExceptionHandling(); $this->get('/response'); } }