Skip to content

Commit 4c8cff7

Browse files
[2.8][PhpUnitBridge] Drop ErrorAssert in favor of @expectedDeprecation
1 parent b81c176 commit 4c8cff7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Tests/ContainerBuilderTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
require_once __DIR__.'/Fixtures/includes/classes.php';
1515
require_once __DIR__.'/Fixtures/includes/ProjectExtension.php';
1616

17-
use Symfony\Bridge\PhpUnit\ErrorAssert;
1817
use Symfony\Component\Config\Resource\ResourceInterface;
1918
use Symfony\Component\DependencyInjection\Alias;
2019
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -61,17 +60,16 @@ public function testDefinitions()
6160
}
6261

6362
/**
64-
* @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered
63+
* @group legacy
64+
* @expectedDeprecation The "deprecated_foo" service is deprecated. You should stop using it, as it will soon be removed.
6565
*/
6666
public function testCreateDeprecatedService()
6767
{
68-
ErrorAssert::assertDeprecationsAreTriggered('The "deprecated_foo" service is deprecated. You should stop using it, as it will soon be removed.', function () {
69-
$definition = new Definition('stdClass');
70-
$definition->setDeprecated(true);
68+
$definition = new Definition('stdClass');
69+
$definition->setDeprecated(true);
7170

72-
$builder = new ContainerBuilder();
73-
$builder->createService($definition, 'deprecated_foo');
74-
});
71+
$builder = new ContainerBuilder();
72+
$builder->createService($definition, 'deprecated_foo');
7573
}
7674

7775
public function testRegister()

0 commit comments

Comments
 (0)