|
12 | 12 | */ |
13 | 13 | final class UriTemplateTest extends TestCase |
14 | 14 | { |
15 | | - public function templateProvider(): array |
| 15 | + public static function templateProvider(): array |
16 | 16 | { |
17 | 17 | $variables = [ |
18 | 18 | 'var' => 'value', |
@@ -126,7 +126,7 @@ public function testExpandsUriTemplates(string $template, string $expansion, arr |
126 | 126 | self::assertSame($expansion, UriTemplate::expand($template, $variables)); |
127 | 127 | } |
128 | 128 |
|
129 | | - public function expressionProvider(): array |
| 129 | + public static function expressionProvider(): array |
130 | 130 | { |
131 | 131 | return [ |
132 | 132 | [ |
@@ -167,12 +167,16 @@ public function testParsesExpressions(string $exp, array $data): void |
167 | 167 | { |
168 | 168 | $template = new UriTemplate(); |
169 | 169 |
|
170 | | - // Access the config object |
171 | 170 | $class = new \ReflectionClass($template); |
| 171 | + |
172 | 172 | $method = $class->getMethod('parseExpression'); |
173 | | - $method->setAccessible(true); |
| 173 | + |
| 174 | + if (PHP_VERSION_ID < 80100) { |
| 175 | + $method->setAccessible(true); |
| 176 | + } |
174 | 177 |
|
175 | 178 | $exp = \substr($exp, 1, -1); |
| 179 | + |
176 | 180 | self::assertSame($data, $method->invokeArgs($template, [$exp])); |
177 | 181 | } |
178 | 182 |
|
@@ -200,7 +204,7 @@ public function testAllowsNestedArrayExpansion(): void |
200 | 204 | self::assertSame('http://example.com/foo/bar/one,two?query=test&more%5B0%5D=fun&more%5B1%5D=ice%20cream&baz%5Bbar%5D=fizz&baz%5Btest%5D=buzz&bam=boo', $result); |
201 | 205 | } |
202 | 206 |
|
203 | | - public function specComplianceProvider(): \Generator |
| 207 | + public static function specComplianceProvider(): \Generator |
204 | 208 | { |
205 | 209 | foreach (['spec-examples.json', 'spec-examples-by-section.json', 'extended-tests.json'] as $filename) { |
206 | 210 | foreach (self::parseSpecExamples($filename) as $example) { |
|
0 commit comments