8000 minor #53695 [DependencyInjection] fix tests (xabbuh) · symfony/symfony@ad1563b · GitHub
[go: up one dir, main page]

Skip to content

Commit ad1563b

Browse files
minor #53695 [DependencyInjection] fix tests (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [DependencyInjection] fix tests | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 001cda8 fix tests
2 parents ce404eb + 001cda8 commit ad1563b

File tree

2 files changed

+18
-1
lines changed
8000

2 files changed

+18
-1
lines changed

src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ public function testDumpHandlesEnumeration()
163163
$container->compile();
164164
$dumper = new YamlDumper($container);
165165

166-
$this->assertEquals(file_get_contents(self::$fixturesPath.'/yaml/services_with_enumeration.yml'), $dumper->dump());
166+
if (str_starts_with(Yaml::dump(FooUnitEnum::BAR), '!php/enum')) {
167+
$this->assertEquals(file_get_contents(self::$fixturesPath.'/yaml/services_with_enumeration_enum_tag.yml'), $dumper->dump());
168+
} else {
169+
$this->assertEquals(file_get_contents(self::$fixturesPath.'/yaml/services_with_enumeration.yml'), $dumper->dump());
170+
}
167171
}
168172

169173
/**
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
parameters:
2+
unit_enum: !php/enum Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR
3+
enum_array: [!php/enum Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR, !php/enum Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::FOO]
4+
5+
services:
6+
service_container:
7+
class: Symfony\Component\DependencyInjection\ContainerInterface
8+
public: true
9+
synthetic: true
10+
Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithEnumAttribute:
11+
class: Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithEnumAttribute
12+
public: true
13+
arguments: [!php/const 'Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR']

0 commit comments

Comments
 (0)
0