Skip to content

Commit b8a4726

Browse files
Merge branch '3.4' into 4.3
* 3.4: [DI] Missing test on YamlFileLoader
2 parents 44af0a3 + ebef5cc commit b8a4726

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Tests/Loader/YamlFileLoaderTest.php

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

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

376379
public function testAutowire()
@@ -821,6 +824,18 @@ public function testOverriddenDefaultsBindings()
821824
$this->assertSame('overridden', $container->get('bar')->quz);
822825
}
823826

827+
/**
828+
* @group legacy
829+
* @expectedDeprecation The configuration key "factory" is unsupported for the service "foo" which is defined as an alias in %s.
830+
* @expectedDeprecation The configuration key "parent" is unsupported for the service "foo" which is defined as an alias in %s.
831+
*/
832+
public function testAliasDefinitionContainsUnsupportedElements()
833+
{
834+
$container = new ContainerBuilder();
835+
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
836+
$loader->load('legacy_invalid_alias_definition.yml');
837+
$this->assertTrue($container->has('foo'));
838+
824839
/**
825840
* When creating a tagged iterator using the array syntax, all optional parameters should be properly handled.
826841
*/

0 commit comments

Comments
 (0)