8000 minor #34675 [DI] Missing test on YamlFileLoader (maxhelias) · symfony/symfony@84b5db3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 84b5db3

Browse files
minor #34675 [DI] Missing test on YamlFileLoader (maxhelias)
This PR was merged into the 3.4 branch. Discussion ---------- [DI] Missing test on YamlFileLoader | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? |no | Deprecations? |no | Tickets | - | License | MIT | Doc PR | - Missing test on YamlFileLoader Commits ------- b9d5237 [DI] Missing test on YamlFileLoader
2 parents 53241df + b9d5237 commit 84b5db3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ public function testParsesIteratorArgument()
349349
$lazyDefinition = $container->getDefinition('lazy_context');
350350

351351
$this->assertEquals([new IteratorArgument(['k1' => new Reference('foo.baz'), 'k2' => new Reference('service_container')]), new IteratorArgument([])], $lazyDefinition->getArguments(), '->load() parses lazy arguments');
352+
353+
$message = 'The "deprecated_service" service is deprecated. You should stop using it, as it will soon be removed.';
354+
$this->assertSame($message, $container->getDefinition('deprecated_service')->getDeprecationMessage('deprecated_service'));
352355
}
353356

354357
public function testAutowire()
@@ -717,4 +720,17 @@ public function testOverriddenDefaultsBindings()
717720

718721
$this->assertSame('overridden', $container->get('bar')->quz);
719722
}
723+
724+
/**
725+
* @group legacy
726+
* @expectedDeprecation The configuration key "factory" is unsupported for the service "foo" which is defined as an alias in %s.
727+
* @expectedDeprecation The configuration key "parent" is unsupported for the service "foo" which is defined as an alias in %s.
728+
*/
729+
public function testAliasDefinitionContainsUnsupportedElements()
730+
{
731+
$container = new ContainerBuilder();
732+
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
733+
$loader->load('legacy_invalid_alias_definition.yml');
734+
$this->assertTrue($container->has('foo'));
735+
}
720736
}

0 commit comments

Comments
 (0)
0