Skip to content

Commit 46aa709

Browse files
Merge branch '5.2' into 5.3
* 5.2: [DI] fix fixture [ErrorHandler] fix handling buffered SilencedErrorContext [HttpClient] fix Psr18Client when allow_url_fopen=0 [DependencyInjection] Add support of PHP enumerations [Cache] handle prefixed redis connections when clearing pools [Cache] fix eventual consistency when using RedisTagAwareAdapter with a cluster [Uid] Fix fromString() with low base58 values [Validator][Translation] Add ExpressionLanguageSyntax en and fr [HttpKernel] [HttpCache] Keep s-maxage=0 from ESI sub-responses Avoid broken action URL in text notification mail [Cache] Disable locking on Windows by default [DependencyInjection] Fix binding "iterable $foo" when using the PHP-DSL [Config] fix tracking default values that reference the parent class [DependencyInjection] fix accepted types on FactoryTrait::factory() [VarDumper] Fix tests for PHP 8.1 [Mailer] fix encoding of addresses using SmtpTransport [MonologBridge] Fix the server:log help --filter sample
2 parents 905a22c + ca2e8ba commit 46aa709

File tree

1 file changed

+72
-6
lines changed

1 file changed

+72
-6
lines changed

Tests/Caster/ReflectionCasterTest.php

Lines changed: 72 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,31 @@ public function testReflectionParameter()
138138
{
139139
$var = new \ReflectionParameter(reflectionParameterFixture::class, 0);
140140

141-
$this->assertDumpMatchesFormat(
142-
<<<'EOTXT'
141+
if (\PHP_VERSION_ID < 80100) {
142+
$this->assertDumpMatchesFormat(
143+
<<<'EOTXT'
143144
ReflectionParameter {
144145
+name: "arg1"
145146
position: 0
146147
typeHint: "Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass"
147148
default: null
148149
}
149150
EOTXT
150-
, $var
151-
);
151+
, $var
152+
);
153+
} else {
154+
$this->assertDumpMatchesFormat(
155+
<<<'EOTXT'
156+
ReflectionParameter {
157+
+name: "arg1"
158+
position: 0
159+
allowsNull: true
160+
typeHint: "Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass"
161+
}
162+
EOTXT
163+
, $var
164+
);
165+
}
152166
}
153167

154168
public function testReflectionParameterScalar()
@@ -422,7 +436,8 @@ public function testGenerator()
422436
$generator = new GeneratorDemo();
423437
$generator = $generator->baz();
424438

425-
$expectedDump = <<<'EODUMP'
439+
if (\PHP_VERSION_ID < 80100) {
440+
$expectedDump = <<<'EODUMP'
426441
Generator {
427442
this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …}
428443
executing: {
@@ -436,14 +451,32 @@ public function testGenerator()
436451
closed: false
437452
}
438453
EODUMP;
454+
} else {
455+
$expectedDump = <<<'EODUMP'
456+
Generator {
457+
this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …}
458+
trace: {
459+
./src/Symfony/Component/VarDumper/Tests/Fixtures/GeneratorDemo.php:13 {
460+
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz()
461+
› public function baz()
462+
› {
463+
› yield from bar();
464+
}
465+
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz() {}
466+
}
467+
closed: false
468+
}
469+
EODUMP;
470+
}
439471

440472
$this->assertDumpMatchesFormat($expectedDump, $generator);
441473

442474
foreach ($generator as $v) {
443475
break;
444476
}
445477

446-
$expectedDump = <<<'EODUMP'
478+
if (\PHP_VERSION_ID < 80100) {
479+
$expectedDump = <<<'EODUMP'
447480
array:2 [
448481
0 => ReflectionGenerator {
449482
this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …}
@@ -472,6 +505,39 @@ public function testGenerator()
472505
}
473506
]
474507
EODUMP;
508+
} else {
509+
$expectedDump = <<<'EODUMP'
510+
array:2 [
511+
0 => ReflectionGenerator {
512+
this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …}
513+
trace: {
514+
%s%eTests%eFixtures%eGeneratorDemo.php:9 {
515+
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo()
516+
› {
517+
› yield 1;
518+
› }
519+
}
520+
%s%eTests%eFixtures%eGeneratorDemo.php:20 { …}
521+
%s%eTests%eFixtures%eGeneratorDemo.php:14 { …}
522+
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz() {}
523+
}
524+
closed: false
525+
}
526+
1 => Generator {
527+
trace: {
528+
./src/Symfony/Component/VarDumper/Tests/Fixtures/GeneratorDemo.php:9 {
529+
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo()
530+
› {
531+
› yield 1;
532+
› }
533+
}
534+
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo() {}
535+
}
536+
closed: false
537+
}
538+
]
539+
EODUMP;
540+
}
475541

476542
$r = new \ReflectionGenerator($generator);
477543
$this->assertDumpMatchesFormat($expectedDump, [$r, $r->getExecutingGenerator()]);

0 commit comments

Comments
 (0)