/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Integration/Routing/SimpleRouteTest.php
39 строк
1 KB
NickSdot
[11.x] Allow enums to be passed to routes (#52561)
23 авг 2024, 19:25
Не верифицирован
23 авг 2024, 19:25
b543d69
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Integration\Routing; use Illuminate\Support\Facades\Route; use Orchestra\Testbench\TestCase; class SimpleRouteTest extends TestCase { public function testSimpleRouteThroughTheFramework() { Route::get('/', function () { return 'Hello World'; }); $response = $this->get('/'); $this->assertSame('Hello World', $response->content()); $response = $this->get('/?foo=bar'); $this->assertSame('Hello World', $response->content()); $this->assertSame('bar', $response->baseRequest->query('foo')); } public function testSimpleRouteWitStringBackedEnumRouteNameThroughTheFramework() { Route::get('/', function () { return 'Hello World'; })->name(RouteNameEnum::UserIndex); $response = $this->get(\route(RouteNameEnum::UserIndex, ['foo' => 'bar'])); $this->assertSame('Hello World', $response->content()); $this->assertSame('bar', $response->baseRequest->query('foo')); } }