/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Bridge/PsrHttpMessage/Tests/Functional/ControllerTest.php
53 строки
1 KB
Alexander M. Turek
Add 'src/Symfony/Bridge/PsrHttpMessage/' from commit '581ca6067eb62640de5ff08ee1ba6850a0ee472e'
27 июл 2023, 20:31
27 июл 2023, 20:31
0c0323a
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\PsrHttpMessage\Tests\Functional; use Symfony\Bridge\PsrHttpMessage\Tests\Fixtures\App\Kernel; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; /** * @author Alexander M. Turek <me@derrabus.de> */ final class ControllerTest extends WebTestCase { public function testServerRequestAction() { $client = self::createClient(); $crawler = $client->request('GET', '/server-request'); self::assertResponseStatusCodeSame(200); self::assertSame('GET', $crawler->text()); } public function testRequestAction() { $client = self::createClient(); $crawler = $client->request('POST', '/request', [], [], [], 'some content'); self::assertResponseStatusCodeSame(403); self::assertSame('POST some content', $crawler->text()); } public function testMessageAction() { $client = self::createClient(); $crawler = $client->request('PUT', '/message', [], [], ['HTTP_X_MY_HEADER' => 'some content']); self::assertResponseStatusCodeSame(422); self::assertSame('some content', $crawler->text()); } protected static function getKernelClass(): string { return Kernel::class; } }