From 2485e15d9d81e509f5d24fb91b0878784e7d0b32 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 13 Apr 2024 14:18:00 +0200 Subject: [PATCH] [PhpUnitBridge] Add ExpectUserDeprecationMessageTrait --- src/Symfony/Bridge/PhpUnit/CHANGELOG.md | 5 ++++ .../ExpectUserDeprecationMessageTrait.php | 30 +++++++++++++++++++ .../DependencyInjection/TwigExtensionTest.php | 6 ++-- .../ImportMap/ImportMapConfigReaderTest.php | 6 ++-- .../Adapter/CouchbaseBucketAdapterTest.php | 6 ++-- .../ResolveReferencesToAliasesPassTest.php | 8 ++--- .../Tests/ContainerBuilderTest.php | 10 +++---- .../Tests/Dumper/PhpDumperTest.php | 10 +++---- .../ParameterBag/FrozenParameterBagTest.php | 6 ++-- .../Tests/ParameterBag/ParameterBagTest.php | 10 +++---- .../Tests/Extension/Core/Type/UrlTypeTest.php | 6 ++-- .../Dumper/CompiledUrlGeneratorDumperTest.php | 10 +++---- .../Tests/Generator/UrlGeneratorTest.php | 10 +++---- .../Component/Yaml/Tests/ParserTest.php | 6 ++-- 14 files changed, 82 insertions(+), 47 deletions(-) create mode 100644 src/Symfony/Bridge/PhpUnit/ExpectUserDeprecationMessageTrait.php diff --git a/src/Symfony/Bridge/PhpUnit/CHANGELOG.md b/src/Symfony/Bridge/PhpUnit/CHANGELOG.md index a8be6586d6c2f..d28ee0caba7df 100644 --- a/src/Symfony/Bridge/PhpUnit/CHANGELOG.md +++ b/src/Symfony/Bridge/PhpUnit/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +7.2 +--- + + * Add `ExpectUserDeprecationMessageTrait` with a polyfill of PHPUnit's `expectUserDeprecationMessage()` + 6.4 --- diff --git a/src/Symfony/Bridge/PhpUnit/ExpectUserDeprecationMessageTrait.php b/src/Symfony/Bridge/PhpUnit/ExpectUserDeprecationMessageTrait.php new file mode 100644 index 0000000000000..ede0bdb2c106b --- /dev/null +++ b/src/Symfony/Bridge/PhpUnit/ExpectUserDeprecationMessageTrait.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bridge\PhpUnit; + +use PHPUnit\Runner\Version; + +if (version_compare(Version::id(), '11.0.0', '<')) { + trait ExpectUserDeprecationMessageTrait + { + use ExpectDeprecationTrait; + + final protected function expectUserDeprecationMessage(string $expectedUserDeprecationMessage): void + { + $this->expectDeprecation($expectedUserDeprecationMessage); + } + } +} else { + trait ExpectUserDeprecationMessageTrait + { + } +} diff --git a/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php b/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php index bc7013c3cb70a..ffe772a28861d 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php @@ -11,7 +11,7 @@ namespace Symfony\Bundle\TwigBundle\Tests\DependencyInjection; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\RuntimeLoaderPass; use Symfony\Bundle\TwigBundle\DependencyInjection\TwigExtension; use Symfony\Bundle\TwigBundle\Tests\DependencyInjection\AcmeBundle\AcmeBundle; @@ -32,7 +32,7 @@ class TwigExtensionTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; public function testLoadEmptyConfiguration() { @@ -111,7 +111,7 @@ public function testLoadCustomBaseTemplateClassConfiguration(string $format) $container = $this->createContainer(); $container->registerExtension(new TwigExtension()); - $this->expectDeprecation('Since symfony/twig-bundle 7.1: The child node "base_template_class" at path "twig" is deprecated.'); + $this->expectUserDeprecationMessage('Since symfony/twig-bundle 7.1: The child node "base_template_class" at path "twig" is deprecated.'); $this->loadFromFile($container, 'templateClass', $format); $this->compileContainer($container); diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapConfigReaderTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapConfigReaderTest.php index ce3464ea19cd9..a83b327f9e503 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapConfigReaderTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapConfigReaderTest.php @@ -12,7 +12,7 @@ namespace Symfony\Component\AssetMapper\Tests\ImportMap; use PHPUnit\Framework\TestCase; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\AssetMapper\ImportMap\ImportMapConfigReader; use Symfony\Component\AssetMapper\ImportMap\ImportMapEntries; use Symfony\Component\AssetMapper\ImportMap\ImportMapEntry; @@ -22,7 +22,7 @@ class ImportMapConfigReaderTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; private Filesystem $filesystem; @@ -168,7 +168,7 @@ public function testFindRootImportMapEntry() */ public function testDeprecatedMethodTriggerDeprecation() { - $this->expectDeprecation('Since symfony/asset-mapper 7.1: The method "Symfony\Component\AssetMapper\ImportMap\ImportMapConfigReader::splitPackageNameAndFilePath()" is deprecated and will be removed in 8.0. Use ImportMapEntry::splitPackageNameAndFilePath() instead.'); + $this->expectUserDeprecationMessage('Since symfony/asset-mapper 7.1: The method "Symfony\Component\AssetMapper\ImportMap\ImportMapConfigReader::splitPackageNameAndFilePath()" is deprecated and will be removed in 8.0. Use ImportMapEntry::splitPackageNameAndFilePath() instead.'); ImportMapConfigReader::splitPackageNameAndFilePath('foo'); } } diff --git a/src/Symfony/Component/Cache/Tests/Adapter/CouchbaseBucketAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/CouchbaseBucketAdapterTest.php index d7511bc67f45c..35c1591c07a69 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/CouchbaseBucketAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/CouchbaseBucketAdapterTest.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Cache\Tests\Adapter; use Psr\Cache\CacheItemPoolInterface; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\Cache\Adapter\AbstractAdapter; use Symfony\Component\Cache\Adapter\CouchbaseBucketAdapter; @@ -26,7 +26,7 @@ */ class CouchbaseBucketAdapterTest extends AdapterTestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; protected $skippedTests = [ 'testClearPrefix' => 'Couchbase cannot clear by prefix', @@ -36,7 +36,7 @@ class CouchbaseBucketAdapterTest extends AdapterTestCase protected function setUp(): void { - $this->expectDeprecation('Since symfony/cache 7.1: The "Symfony\Component\Cache\Adapter\CouchbaseBucketAdapter" class is deprecated, use "Symfony\Component\Cache\Adapter\CouchbaseCollectionAdapter" instead.'); + $this->expectUserDeprecationMessage('Since symfony/cache 7.1: The "Symfony\Component\Cache\Adapter\CouchbaseBucketAdapter" class is deprecated, use "Symfony\Component\Cache\Adapter\CouchbaseCollectionAdapter" instead.'); $this->client = AbstractAdapter::createConnection('couchbase://'.getenv('COUCHBASE_HOST').'/cache', ['username' => getenv('COUCHBASE_USER'), 'password' => getenv('COUCHBASE_PASS')] diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php index dd26ff8285ebd..aedf7fa5420f2 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php @@ -12,7 +12,7 @@ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -22,7 +22,7 @@ class ResolveReferencesToAliasesPassTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; public function testProcess() { @@ -92,7 +92,7 @@ public function testResolveFactory() */ public function testDeprecationNoticeWhenReferencedByAlias() { - $this->expectDeprecation('Since foobar 1.2.3.4: The "deprecated_foo_alias" service alias is deprecated. You should stop using it, as it will be removed in the future. It is being referenced by the "alias" alias.'); + $this->expectUserDeprecationMessage('Since foobar 1.2.3.4: The "deprecated_foo_alias" service alias is deprecated. You should stop using it, as it will be removed in the future. It is being referenced by the "alias" alias.'); $container = new ContainerBuilder(); $container->register('foo', 'stdClass'); @@ -114,7 +114,7 @@ public function testDeprecationNoticeWhenReferencedByAlias() */ public function testDeprecationNoticeWhenReferencedByDefinition() { - $this->expectDeprecation('Since foobar 1.2.3.4: The "foo_aliased" service alias is deprecated. You should stop using it, as it will be removed in the future. It is being referenced by the "definition" service.'); + $this->expectUserDeprecationMessage('Since foobar 1.2.3.4: The "foo_aliased" service alias is deprecated. You should stop using it, as it will be removed in the future. It is being referenced by the "definition" service.'); $container = new ContainerBuilder(); $container->register('foo', 'stdClass'); diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index d918782b2dfbf..7c0e7cbcec579 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -16,7 +16,7 @@ require_once __DIR__.'/Fixtures/includes/ProjectExtension.php'; use PHPUnit\Framework\TestCase; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\Config\Resource\DirectoryResource; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\Config\Resource\ResourceInterface; @@ -62,7 +62,7 @@ class ContainerBuilderTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; public function testDefaultRegisteredDefinitions() { @@ -116,7 +116,7 @@ public function testDeprecateParameter() $builder->deprecateParameter('foo', 'symfony/test', '6.3'); - $this->expectDeprecation('Since symfony/test 6.3: The parameter "foo" is deprecated.'); + $this->expectUserDeprecationMessage('Since symfony/test 6.3: The parameter "foo" is deprecated.'); $builder->getParameter('foo'); } @@ -134,7 +134,7 @@ public function testParameterDeprecationIsTrgiggeredWhenCompiled() $builder->deprecateParameter('bar', 'symfony/test', '6.3'); - $this->expectDeprecation('Since symfony/test 6.3: The parameter "bar" is deprecated.'); + $this->expectUserDeprecationMessage('Since symfony/test 6.3: The parameter "bar" is deprecated.'); $builder->compile(); } @@ -1918,7 +1918,7 @@ public function testAutoAliasing() */ public function testDirectlyAccessingDeprecatedPublicService() { - $this->expectDeprecation('Since foo/bar 3.8: Accessing the "Symfony\Component\DependencyInjection\Tests\A" service directly from the container is deprecated, use dependency injection instead.'); + $this->expectUserDeprecationMessage('Since foo/bar 3.8: Accessing the "Symfony\Component\DependencyInjection\Tests\A" service directly from the container is deprecated, use dependency injection instead.'); $container = new ContainerBuilder(); $container diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index 025dea24afcd5..eb199b72436de 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -13,7 +13,7 @@ use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Argument\AbstractArgument; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; @@ -76,7 +76,7 @@ class PhpDumperTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; protected static string $fixturesPath; @@ -485,7 +485,7 @@ public function testDeprecatedParameters() { $container = include self::$fixturesPath.'/containers/container_deprecated_parameters.php'; - $this->expectDeprecation('Since symfony/test 6.3: The parameter "foo_class" is deprecated.'); + $this->expectUserDeprecationMessage('Since symfony/test 6.3: The parameter "foo_class" is deprecated.'); $container->compile(); $dumper = new PhpDumper($container); @@ -502,7 +502,7 @@ public function testDeprecatedParametersAsFiles() { $container = include self::$fixturesPath.'/containers/container_deprecated_parameters.php'; - $this->expectDeprecation('Since symfony/test 6.3: The parameter "foo_class" is deprecated.'); + $this->expectUserDeprecationMessage('Since symfony/test 6.3: The parameter "foo_class" is deprecated.'); $container->compile(); $dumper = new PhpDumper($container); @@ -1702,7 +1702,7 @@ public function testDumpServiceWithAbstractArgument() */ public function testDirectlyAccessingDeprecatedPublicService() { - $this->expectDeprecation('Since foo/bar 3.8: Accessing the "bar" service directly from the container is deprecated, use dependency injection instead.'); + $this->expectUserDeprecationMessage('Since foo/bar 3.8: Accessing the "bar" service directly from the container is deprecated, use dependency injection instead.'); $container = new ContainerBuilder(); $container diff --git a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php index 792a9c2455cef..2a40401826bbf 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php @@ -12,12 +12,12 @@ namespace Symfony\Component\DependencyInjection\Tests\ParameterBag; use PHPUnit\Framework\TestCase; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; class FrozenParameterBagTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; public function testConstructor() { @@ -76,7 +76,7 @@ public function testGetDeprecated() ['foo' => ['symfony/test', '6.3', 'The parameter "%s" is deprecated.', 'foo']] ); - $this->expectDeprecation('Since symfony/test 6.3: The parameter "foo" is deprecated.'); + $this->expectUserDeprecationMessage('Since symfony/test 6.3: The parameter "foo" is deprecated.'); $bag->get('foo'); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php index 1a087ef356d78..8ea8de8d1f3a9 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php @@ -12,7 +12,7 @@ namespace Symfony\Component\DependencyInjection\Tests\ParameterBag; use PHPUnit\Framework\TestCase; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; @@ -21,7 +21,7 @@ class ParameterBagTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; public function testConstructor() { @@ -149,7 +149,7 @@ public function testDeprecate() $bag->deprecate('foo', 'symfony/test', '6.3'); - $this->expectDeprecation('Since symfony/test 6.3: The parameter "foo" is deprecated.'); + $this->expectUserDeprecationMessage('Since symfony/test 6.3: The parameter "foo" is deprecated.'); $bag->get('foo'); } @@ -165,7 +165,7 @@ public function testDeprecateWithMessage() $bag->deprecate('foo', 'symfony/test', '6.3', 'The parameter "%s" is deprecated, use "new_foo" instead.'); - $this->expectDeprecation('Since symfony/test 6.3: The parameter "foo" is deprecated, use "new_foo" instead.'); + $this->expectUserDeprecationMessage('Since symfony/test 6.3: The parameter "foo" is deprecated, use "new_foo" instead.'); $bag->get('foo'); } @@ -181,7 +181,7 @@ public function testDeprecationIsTriggeredWhenResolved() $bag->deprecate('bar', 'symfony/test', '6.3'); - $this->expectDeprecation('Since symfony/test 6.3: The parameter "bar" is deprecated.'); + $this->expectUserDeprecationMessage('Since symfony/test 6.3: The parameter "bar" is deprecated.'); $bag->resolve(); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/UrlTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/UrlTypeTest.php index 28e8b9ac746d6..243d15297c5fb 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/UrlTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/UrlTypeTest.php @@ -11,12 +11,12 @@ namespace Symfony\Component\Form\Tests\Extension\Core\Type; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; class UrlTypeTest extends TextTypeTest { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\UrlType'; @@ -25,7 +25,7 @@ class UrlTypeTest extends TextTypeTest */ public function testSubmitAddsDefaultProtocolIfNoneIsIncluded() { - $this->expectDeprecation('Since symfony/form 7.1: Not configuring the "default_protocol" option when using the UrlType is deprecated. It will default to "null" in 8.0.'); + $this->expectUserDeprecationMessage('Since symfony/form 7.1: Not configuring the "default_protocol" option when using the UrlType is deprecated. It will default to "null" in 8.0.'); $form = $this->factory->create(static::TESTED_TYPE, 'name'); $form->submit('www.domain.com'); diff --git a/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php b/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php index 333cc9f42dc86..a7bbefbced148 100644 --- a/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php +++ b/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Routing\Tests\Generator\Dumper; use PHPUnit\Framework\TestCase; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\Routing\Exception\RouteCircularReferenceException; use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\Generator\CompiledUrlGenerator; @@ -24,7 +24,7 @@ class CompiledUrlGeneratorDumperTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; private RouteCollection $routeCollection; private CompiledUrlGeneratorDumper $generatorDumper; @@ -347,7 +347,7 @@ public function testIndirectCircularReferenceShouldThrowAnException() */ public function testDeprecatedAlias() { - $this->expectDeprecation('Since foo/bar 1.0.0: The "b" route alias is deprecated. You should stop using it, as it will be removed in the future.'); + $this->expectUserDeprecationMessage('Since foo/bar 1.0.0: The "b" route alias is deprecated. You should stop using it, as it will be removed in the future.'); $this->routeCollection->add('a', new Route('/foo')); $this->routeCollection->addAlias('b', 'a') @@ -365,7 +365,7 @@ public function testDeprecatedAlias() */ public function testDeprecatedAliasWithCustomMessage() { - $this->expectDeprecation('Since foo/bar 1.0.0: foo b.'); + $this->expectUserDeprecationMessage('Since foo/bar 1.0.0: foo b.'); $this->routeCollection->add('a', new Route('/foo')); $this->routeCollection->addAlias('b', 'a') @@ -383,7 +383,7 @@ public function testDeprecatedAliasWithCustomMessage() */ public function testTargettingADeprecatedAliasShouldTriggerDeprecation() { - $this->expectDeprecation('Since foo/bar 1.0.0: foo b.'); + $this->expectUserDeprecationMessage('Since foo/bar 1.0.0: foo b.'); $this->routeCollection->add('a', new Route('/foo')); $this->routeCollection->addAlias('b', 'a') diff --git a/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php b/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php index 858b286301ab8..25a4c67460c82 100644 --- a/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php +++ b/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php @@ -13,7 +13,7 @@ use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\Routing\Exception\InvalidParameterException; use Symfony\Component\Routing\Exception\MissingMandatoryParametersException; use Symfony\Component\Routing\Exception\RouteCircularReferenceException; @@ -26,7 +26,7 @@ class UrlGeneratorTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; public function testAbsoluteUrlWithPort80() { @@ -811,7 +811,7 @@ public function testAliasWhichTargetRouteDoesntExist() */ public function testDeprecatedAlias() { - $this->expectDeprecation('Since foo/bar 1.0.0: The "b" route alias is deprecated. You should stop using it, as it will be removed in the future.'); + $this->expectUserDeprecationMessage('Since foo/bar 1.0.0: The "b" route alias is deprecated. You should stop using it, as it will be removed in the future.'); $routes = new RouteCollection(); $routes->add('a', new Route('/foo')); @@ -826,7 +826,7 @@ public function testDeprecatedAlias() */ public function testDeprecatedAliasWithCustomMessage() { - $this->expectDeprecation('Since foo/bar 1.0.0: foo b.'); + $this->expectUserDeprecationMessage('Since foo/bar 1.0.0: foo b.'); $routes = new RouteCollection(); $routes->add('a', new Route('/foo')); @@ -841,7 +841,7 @@ public function testDeprecatedAliasWithCustomMessage() */ public function testTargettingADeprecatedAliasShouldTriggerDeprecation() { - $this->expectDeprecation('Since foo/bar 1.0.0: foo b.'); + $this->expectUserDeprecationMessage('Since foo/bar 1.0.0: foo b.'); $routes = new RouteCollection(); $routes->add('a', new Route('/foo')); diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index ba5bffb5a0b15..fad946946b503 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Yaml\Tests; use PHPUnit\Framework\TestCase; -use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; +use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Parser; use Symfony\Component\Yaml\Tag\TaggedValue; @@ -20,7 +20,7 @@ class ParserTest extends TestCase { - use ExpectDeprecationTrait; + use ExpectUserDeprecationMessageTrait; private ?Parser $parser; @@ -1037,7 +1037,7 @@ public static function getParseExceptionOnDuplicateData() */ public function testNullAsDuplicatedData() { - $this->expectDeprecation('Since symfony/yaml 7.2: Duplicate key "child" detected on line 4 whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated and will throw a ParseException in 8.0.'); + $this->expectUserDeprecationMessage('Since symfony/yaml 7.2: Duplicate key "child" detected on line 4 whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated and will throw a ParseException in 8.0.'); $yaml = << pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy