|
1 | 1 | <?php
|
| 2 | + |
2 | 3 | declare(strict_types=1);
|
3 | 4 |
|
4 | 5 | namespace Plugin;
|
@@ -29,18 +30,18 @@ function () {}
|
29 | 30 | public function provideRedirections(): array
|
30 | 31 | {
|
31 | 32 | return [
|
32 |
| - 'no path on target' => ["https://example.com/path?query=value", "https://example.com?query=value", "https://example.com?query=value"], |
33 |
| - 'root path on target' => ["https://example.com/path?query=value", "https://example.com/?query=value", "https://example.com/?query=value"], |
34 |
| - 'redirect to query' => ["https://example.com", "https://example.com?query=value", "https://example.com?query=value"], |
35 |
| - 'redirect to different domain without port' => ["https://example.com:8000", "https://foo.com?query=value", "https://foo.com?query=value"], |
36 |
| - 'network-path redirect, preserve scheme' => ["https://example.com:8000", "//foo.com/path?query=value", "https://foo.com/path?query=value"], |
37 |
| - 'absolute-path redirect, preserve host' => ["https://example.com:8000", "/path?query=value", "https://example.com:8000/path?query=value"], |
38 |
| - 'relative-path redirect, append' => ["https://example.com:8000/path/", "sub/path?query=value", "https://example.com:8000/path/sub/path?query=value"], |
39 |
| - 'relative-path on non-folder' => ["https://example.com:8000/path/foo", "sub/path?query=value", "https://example.com:8000/path/sub/path?query=value"], |
40 |
| - 'relative-path moving up' => ["https://example.com:8000/path/", "../other?query=value", "https://example.com:8000/other?query=value"], |
41 |
| - 'relative-path with ./' => ["https://example.com:8000/path/", "./other?query=value", "https://example.com:8000/path/other?query=value"], |
42 |
| - 'relative-path with //' => ["https://example.com:8000/path/", "other//sub?query=value", "https://example.com:8000/path/other//sub?query=value"], |
43 |
| - 'relative-path redirect with only query' => ["https://example.com:8000/path", "?query=value", "https://example.com:8000/path?query=value"], |
| 33 | + 'no path on target' => ['https://example.com/path?query=value', 'https://example.com?query=value', 'https://example.com?query=value'], |
| 34 | + 'root path on target' => ['https://example.com/path?query=value', 'https://example.com/?query=value', 'https://example.com/?query=value'], |
| 35 | + 'redirect to query' => ['https://example.com', 'https://example.com?query=value', 'https://example.com?query=value'], |
| 36 | + 'redirect to different domain without port' => ['https://example.com:8000', 'https://foo.com?query=value', 'https://foo.com?query=value'], |
| 37 | + 'network-path redirect, preserve scheme' => ['https://example.com:8000', '//foo.com/path?query=value', 'https://foo.com/path?query=value'], |
| 38 | + 'absolute-path redirect, preserve host' => ['https://example.com:8000', '/path?query=value', 'https://example.com:8000/path?query=value'], |
| 39 | + 'relative-path redirect, append' => ['https://example.com:8000/path/', 'sub/path?query=value', 'https://example.com:8000/path/sub/path?query=value'], |
| 40 | + 'relative-path on non-folder' => ['https://example.com:8000/path/foo', 'sub/path?query=value', 'https://example.com:8000/path/sub/path?query=value'], |
| 41 | + 'relative-path moving up' => ['https://example.com:8000/path/', '../other?query=value', 'https://example.com:8000/other?query=value'], |
| 42 | + 'relative-path with ./' => ['https://example.com:8000/path/', './other?query=value', 'https://example.com:8000/path/other?query=value'], |
| 43 | + 'relative-path with //' => ['https://example.com:8000/path/', 'other//sub?query=value', 'https://example.com:8000/path/other//sub?query=value'], |
| 44 | + 'relative-path redirect with only query' => ['https://example.com:8000/path', '?query=value', 'https://example.com:8000/path?query=value'], |
44 | 45 | ];
|
45 | 46 | }
|
46 | 47 |
|
|
0 commit comments