8000 [2.8][PhpUnitBridge] Drop ErrorAssert in favor of @expectedDeprecation · symfony/symfony@5d5f704 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d5f704

Browse files
[2.8][PhpUnitBridge] Drop ErrorAssert in favor of @expectedDeprecation
1 parent 5a08a32 commit 5d5f704

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

src/Symfony/Component/DependencyInjection/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()

src/Symfony/Component/Yaml/Tests/ParserTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Yaml\Tests;
1313

14-
use Symfony\Bridge\PhpUnit\ErrorAssert;
1514
use Symfony\Component\Yaml\Yaml;
1615
use Symfony\Component\Yaml\Parser;
1716

@@ -927,19 +926,16 @@ public function testFloatKeys()
927926

928927
/**
929928
* @group legacy
929+
* @expectedDeprecation Using a colon in the unquoted mapping value "bar: baz" in line 1 is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
930930
* throw ParseException in Symfony 3.0
931-
* @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered
932931
*/
933932
public function testColonInMappingVa 8E30 lueException()
934933
{
935-
$parser = $this->parser;
936-
937-
ErrorAssert::assertDeprecationsAreTriggered('Using a colon in the unquoted mapping value "bar: baz" in line 1 is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.', function () use ($parser) {
938-
$yaml = <<<EOF
934+
$yaml = <<<EOF
939935
foo: bar: baz
940936
EOF;
941-
$parser->parse($yaml);
942-
});
937+
938+
$this->parser->parse($yaml);
943939
}
944940

945941
public function testColonInMappingValueExceptionNotTriggeredByColonInComment()

0 commit comments

Comments
 (0)
0