/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Integration/View/RenderableViewExceptionTest.php
36 строк
846 B
Mior Muhammad Zaki
[11.x] Test improvements (#54879)
04 мар 2025, 17:53
Не верифицирован
04 мар 2025, 17:53
c666f89
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Integration\View; use Exception; use Illuminate\Http\Response; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\View; use Orchestra\Testbench\TestCase; class RenderableViewExceptionTest extends TestCase { public function testRenderMethodOfExceptionThrownInViewGetsHandled() { Route::get('/', function () { return View::make('renderable-exception'); }); $response = $this->get('/'); $response->assertSee('This is a renderable exception.'); } protected function defineEnvironment($app) { $app['config']->set('view.paths', [__DIR__.'/templates']); } } class RenderableException extends Exception { public function render($request) { return new Response('This is a renderable exception.'); } }