|
11 | 11 |
|
12 | 12 | namespace Symfony\Component\DependencyInjection\Tests\Loader;
|
13 | 13 |
|
14 |
| -use Symfony\Bridge\PhpUnit\ErrorAssert; |
15 | 14 | use Symfony\Component\DependencyInjection\ContainerInterface;
|
16 | 15 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
17 | 16 | use Symfony\Component\DependencyInjection\Reference;
|
@@ -558,23 +557,17 @@ public function testAutowire()
|
558 | 557 |
|
559 | 558 | /**
|
560 | 559 | * @group legacy
|
561 |
| - * @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered |
| 560 | + * @expectedDeprecation Using the attribute "class" is deprecated for the service "bar" which is defined as an alias %s. |
| 561 | + * @expectedDeprecation Using the element "tag" is deprecated for the service "bar" which is defined as an alias %s. |
| 562 | + * @expectedDeprecation Using the element "factory" is deprecated for the service "bar" which is defined as an alias %s. |
562 | 563 | */
|
563 | 564 | public function testAliasDefinitionContainsUnsupportedElements()
|
564 | 565 | {
|
565 |
| - $deprecations = array( |
566 |
| - 'Using the attribute "class" is deprecated for the service "bar" which is defined as an alias', |
567 |
| - 'Using the element "tag" is deprecated for the service "bar" which is defined as an alias', |
568 |
| - 'Using the element "factory" is deprecated for the service "bar" which is defined as an alias', |
569 |
| - ); |
570 |
| - |
571 |
| - ErrorAssert::assertDeprecationsAreTriggered($deprecations, function () { |
572 |
| - $container = new ContainerBuilder(); |
573 |
| - $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); |
| 566 | + $container = new ContainerBuilder(); |
| 567 | + $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); |
574 | 568 |
|
575 |
| - $loader->load('legacy_invalid_alias_definition.xml'); |
| 569 | + $loader->load('legacy_invalid_alias_definition.xml'); |
576 | 570 |
|
577 |
| - $this->assertTrue($container->has('bar')); |
578 |
| - }); |
| 571 | + $this->assertTrue($container->has('bar')); |
579 | 572 | }
|
580 | 573 | }
|
0 commit comments