Skip to content

Commit 3883a07

Browse files
committed
fix tests
1 parent e4cfb66 commit 3883a07

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_with_enumeration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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]
2+
unit_enum: !php/const Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR
3+
enum_array: [!php/const Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR, !php/const Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::FOO]
44

55
services:
66
service_container:

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_with_enumeration_enum_tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ services:
1010
Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithEnumAttribute:
1111
class: Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithEnumAttribute
1212
public: true
13-
arguments: [!php/const 'Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR']
13+
arguments: [!php/enum 'Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAR']

src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
use Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy;
4444
use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype;
4545
use Symfony\Component\ExpressionLanguage\Expression;
46+
use Symfony\Component\Yaml\Yaml;
4647

4748
class YamlFileLoaderTest extends TestCase
4849
{
@@ -1020,7 +1021,13 @@ public function testInvalidEnumeration()
10201021
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
10211022

10221023
$this->expectException(InvalidArgumentException::class);
1023-
$this->expectExceptionMessage('The enum "Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAZ" is not defined');
1024+
1025+
if (str_starts_with(Yaml::dump(FooUnitEnum::BAR), '!php/enum')) {
1026+
$this->expectExceptionMessage('The string "Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAZ" is not the name of a valid enum');
1027+
} else {
1028+
$this->expectExceptionMessage('The enum "Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum::BAZ" is not defined');
1029+
}
1030+
10241031
$loader->load('services_with_invalid_enumeration.yml');
10251032
}
10261033

src/Symfony/Component/DependencyInjection/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
"symfony/var-exporter": "^6.4|^7.0"
2424
},
2525
"require-dev": {
26-
"symfony/yaml": "^7.1",
26+
"symfony/yaml": "^6.4|^7.0",
2727
"symfony/config": "^6.4|^7.0",
2828
"symfony/expression-language": "^6.4|^7.0"
2929
},
3030
"conflict": {
3131
"ext-psr": "<1.1|>=2",
3232
"symfony/config": "<6.4",
3333
"symfony/finder": "<6.4",
34-
"symfony/yaml": "<7.1"
34+
"symfony/yaml": "<6.4"
3535
},
3636
"provide": {
3737
"psr/container-implementation": "1.1|2.0",

0 commit comments

Comments
 (0)