Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jan 31, 2024
1 parent 6871811 commit da332ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Tests/Dumper/YamlDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ public function testDumpHandlesEnumeration()
$container->compile();
$dumper = new YamlDumper($container);

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

/**
Expand Down
13 changes: 13 additions & 0 deletions Tests/Fixtures/yaml/services_with_enumeration_enum_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
unit_enum: !php/enum Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR
enum_array: [!php/enum Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR, !php/enum Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::FOO]

services:
service_container:
class: Symfony\Component\DependencyInjection\ContainerInterface
public: true
synthetic: true
Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithEnumAttribute:
class: Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithEnumAttribute
public: true
arguments: [!php/const 'Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR']

0 comments on commit da332ce

Please sign in to comment.