File
2 years ago
Fixtures
2 years ago
Session
2 years ago
schema
2 years ago
AcceptHeaderItemTest.php
2 years ago
AcceptHeaderTest.php
2 years ago
ApacheRequestTest.php
2 years ago
BinaryFileResponseTest.php
2 years ago
CookieTest.php
2 years ago
ExpressionRequestMatcherTest.php
2 years ago
FileBagTest.php
2 years ago
HeaderBagTest.php
2 years ago
IpUtilsTest.php
2 years ago
JsonResponseTest.php
2 years ago
ParameterBagTest.php
2 years ago
RedirectResponseTest.php
2 years ago
RequestMatcherTest.php
2 years ago
RequestStackTest.php
2 years ago
RequestTest.php
2 years ago
ResponseFunctionalTest.php
2 years ago
ResponseHeaderBagTest.php
2 years ago
ResponseTest.php
2 years ago
ResponseTestCase.php
2 years ago
ServerBagTest.php
2 years ago
StreamedResponseTest.php
2 years ago
ResponseFunctionalTest.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | * |
| 11 | * Modified by impress-org on 23-January-2024 using Strauss. |
| 12 | * @see https://github.com/BrianHenryIE/strauss |
| 13 | */ |
| 14 | |
| 15 | namespace Give\Vendors\Symfony\Component\HttpFoundation\Tests; |
| 16 | |
| 17 | use PHPUnit\Framework\TestCase; |
| 18 | |
| 19 | /** |
| 20 | * @requires PHP 7.0 |
| 21 | */ |
| 22 | class ResponseFunctionalTest extends TestCase |
| 23 | { |
| 24 | private static $server; |
| 25 | |
| 26 | public static function setUpBeforeClass() |
| 27 | { |
| 28 | $spec = [ |
| 29 | 1 => ['file', '/dev/null', 'w'], |
| 30 | 2 => ['file', '/dev/null', 'w'], |
| 31 | ]; |
| 32 | if (!self::$server = @proc_open('exec php -S localhost:8054', $spec, $pipes, __DIR__.'/Fixtures/response-functional')) { |
| 33 | self::markTestSkipped('PHP server unable to start.'); |
| 34 | } |
| 35 | sleep(1); |
| 36 | } |
| 37 | |
| 38 | public static function tearDownAfterClass() |
| 39 | { |
| 40 | if (self::$server) { |
| 41 | proc_terminate(self::$server); |
| 42 | proc_close(self::$server); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * @dataProvider provideCookie |
| 48 | */ |
| 49 | public function testCookie($fixture) |
| 50 | { |
| 51 | if (\PHP_VERSION_ID >= 80000 && 'cookie_max_age' === $fixture) { |
| 52 | $this->markTestSkipped('This fixture produces a fatal error on PHP 8.'); |
| 53 | } |
| 54 | |
| 55 | $result = file_get_contents(sprintf('http://localhost:8054/%s.php', $fixture)); |
| 56 | $this->assertStringMatchesFormatFile(__DIR__.sprintf('/Fixtures/response-functional/%s.expected', $fixture), $result); |
| 57 | } |
| 58 | |
| 59 | public function provideCookie() |
| 60 | { |
| 61 | foreach (glob(__DIR__.'/Fixtures/response-functional/*.php') as $file) { |
| 62 | yield [pathinfo($file, \PATHINFO_FILENAME)]; |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 |