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
ApacheRequestTest.php
97 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 | use Give\Vendors\Symfony\Component\HttpFoundation\ApacheRequest; |
| 19 | |
| 20 | class ApacheRequestTest extends TestCase |
| 21 | { |
| 22 | /** |
| 23 | * @dataProvider provideServerVars |
| 24 | */ |
| 25 | public function testUriMethods($server, $expectedRequestUri, $expectedBaseUrl, $expectedPathInfo) |
| 26 | { |
| 27 | $request = new ApacheRequest(); |
| 28 | $request->server->replace($server); |
| 29 | |
| 30 | $this->assertEquals($expectedRequestUri, $request->getRequestUri(), '->getRequestUri() is correct'); |
| 31 | $this->assertEquals($expectedBaseUrl, $request->getBaseUrl(), '->getBaseUrl() is correct'); |
| 32 | $this->assertEquals($expectedPathInfo, $request->getPathInfo(), '->getPathInfo() is correct'); |
| 33 | } |
| 34 | |
| 35 | public function provideServerVars() |
| 36 | { |
| 37 | return [ |
| 38 | [ |
| 39 | [ |
| 40 | 'REQUEST_URI' => '/foo/app_dev.php/bar', |
| 41 | 'SCRIPT_NAME' => '/foo/app_dev.php', |
| 42 | 'PATH_INFO' => '/bar', |
| 43 | ], |
| 44 | '/foo/app_dev.php/bar', |
| 45 | '/foo/app_dev.php', |
| 46 | '/bar', |
| 47 | ], |
| 48 | [ |
| 49 | [ |
| 50 | 'REQUEST_URI' => '/foo/bar', |
| 51 | 'SCRIPT_NAME' => '/foo/app_dev.php', |
| 52 | ], |
| 53 | '/foo/bar', |
| 54 | '/foo', |
| 55 | '/bar', |
| 56 | ], |
| 57 | [ |
| 58 | [ |
| 59 | 'REQUEST_URI' => '/app_dev.php/foo/bar', |
| 60 | 'SCRIPT_NAME' => '/app_dev.php', |
| 61 | 'PATH_INFO' => '/foo/bar', |
| 62 | ], |
| 63 | '/app_dev.php/foo/bar', |
| 64 | '/app_dev.php', |
| 65 | '/foo/bar', |
| 66 | ], |
| 67 | [ |
| 68 | [ |
| 69 | 'REQUEST_URI' => '/foo/bar', |
| 70 | 'SCRIPT_NAME' => '/app_dev.php', |
| 71 | ], |
| 72 | '/foo/bar', |
| 73 | '', |
| 74 | '/foo/bar', |
| 75 | ], |
| 76 | [ |
| 77 | [ |
| 78 | 'REQUEST_URI' => '/app_dev.php', |
| 79 | 'SCRIPT_NAME' => '/app_dev.php', |
| 80 | ], |
| 81 | '/app_dev.php', |
| 82 | '/app_dev.php', |
| 83 | '/', |
| 84 | ], |
| 85 | [ |
| 86 | [ |
| 87 | 'REQUEST_URI' => '/', |
| 88 | 'SCRIPT_NAME' => '/app_dev.php', |
| 89 | ], |
| 90 | '/', |
| 91 | '', |
| 92 | '/', |
| 93 | ], |
| 94 | ]; |
| 95 | } |
| 96 | } |
| 97 |