/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Integration/Foundation/Testing/Concerns/MakeHttpRequestsTest.php
35 строк
1 KB
Mior Muhammad Zaki
[11.x] Allow using `Illuminate\Support\Uri` on testing HTTP Requests (#54038)
30 дек 2024, 18:53
Не верифицирован
30 дек 2024, 18:53
16c01c2
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Integration\Foundation\Testing\Concerns; use Illuminate\Http\Request; use Illuminate\Support\Uri; use Orchestra\Testbench\Attributes\WithConfig; use Orchestra\Testbench\TestCase; #[WithConfig('app.key', 'base64:IUHRqAQ99pZ0A1MPjbuv1D6ff3jxv0GIvS2qIW4JNU4=')] class MakeHttpRequestsTest extends TestCase { /** {@inheritDoc} */ protected function defineWebRoutes($router) { $router->get('decode', fn (Request $request) => [ 'url' => $request->fullUrl(), 'query' => $request->query(), ]); } public function test_it_can_use_uri_to_make_request() { $this->getJson(Uri::of('decode')->withQuery(['editing' => true, 'editMode' => 'create', 'search' => 'Laravel'])) ->assertSuccessful() ->assertJson([ 'url' => 'http://localhost/decode?editMode=create&editing=1&search=Laravel', 'query' => [ 'editing' => '1', 'editMode' => 'create', 'search' => 'Laravel', ], ]); } }