8000 Switch to ExpectUserDeprecationMessageTrait · symfony/symfony@d923c28 · GitHub
[go: up one dir, main page]

Skip to content

Commit d923c28

Browse files
committed
Switch to ExpectUserDeprecationMessageTrait
1 parent a11a20e commit d923c28

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Psr\Cache\CacheItemPoolInterface;
1515< 8000 /td>
use Psr\Log\LoggerAwareInterface;
16-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
16+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1717
use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension;
1818
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1919
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage;
@@ -98,7 +98,7 @@
9898

9999
abstract class FrameworkExtensionTestCase extends TestCase
100100
{
101-
use ExpectDeprecationTrait;
101+
use ExpectUserDeprecationMessageTrait;
102102

103103
private static array $containerCache = [];
104104

@@ -1863,7 +1863,7 @@ public function testCacheTaggableTagAppliedToPools()
18631863
*/
18641864
public function testTaggableCacheAppIsDeprecated()
18651865
{
1866-
$this->expectDeprecation('Since symfony/framework-bundle 7.2: Using the "tags" option with the "cache.app" adapter is deprecated. You can use the "cache.app.taggable" adapter instead (aliased to the TagAwareCacheInterface for autowiring).');
1866+
$this->expectUserDeprecationMessage('Since symfony/framework-bundle 7.2: Using the "tags" option with the "cache.app" adapter is deprecated. You can use the "cache.app.taggable" adapter instead (aliased to the TagAwareCacheInterface for autowiring).');
18671867

18681868
$this->createContainerFromFile('cache_cacheapp_tagaware');
18691869
}

src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Loader;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
15+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1616
use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
1717
use Symfony\Component\Config\Exception\LoaderLoadException;
1818
use Symfony\Component\Config< 6D40 /span>\FileLocator;
@@ -49,7 +49,7 @@
4949

5050
class XmlFileLoaderTest extends TestCase
5151
{
52-
use ExpectDeprecationTrait;
52+
use ExpectUserDeprecationMessageTrait;
5353

5454
protected static string $fixturesPath;
5555

@@ -1340,7 +1340,7 @@ public function testDeprecatedTagged()
13401340
$container = new ContainerBuilder();
13411341
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
13421342

1343-
$this->expectDeprecation(\sprintf('Since symfony/dependency-injection 7.2: Type "tagged" is deprecated for tag <argument>, use "tagged_iterator" instead in "%s/xml%sservices_with_deprecated_tagged.xml".', self::$fixturesPath, \DIRECTORY_SEPARATOR));
1343+
$this->expectUserDeprecationMessage(\sprintf(< 9E88 span class="pl-s">'Since symfony/dependency-injection 7.2: Type "tagged" is deprecated for tag <argument>, use "tagged_iterator" instead in "%s/xml%sservices_with_deprecated_tagged.xml".', self::$fixturesPath, \DIRECTORY_SEPARATOR));
13441344

13451345
$loader->load('services_with_deprecated_tagged.xml');
13461346
}

src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Loader;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
15+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1616
use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
1717
use Symfony\Component\Config\Exception\LoaderLoadException;
1818
use Symfony\Component\Config\FileLocator;
@@ -48,7 +48,7 @@
4848

4949
class YamlFileLoaderTest extends TestCase
5050
{
51-
use ExpectDeprecationTrait;
51+
use ExpectUserDeprecationMessageTrait;
5252

5353
protected static string $fixturesPath;
5454

@@ -1211,7 +1211,7 @@ public function testDeprecatedTagged()
12111211
$container = new ContainerBuilder();
12121212
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml'));
12131213

1214-
$this->expectDeprecation(\sprintf('Since symfony/dependency-injection 7.2: Using "!tagged" is deprecated, use "!tagged_iterator" instead in "%s/yaml%stagged_deprecated.yml".', self::$fixturesPath, \DIRECTORY_SEPARATOR));
1214+
$this->expectUserDeprecationMessage(\sprintf('Since symfony/dependency-injection 7.2: Using "!tagged" is deprecated, use "!tagged_iterator" instead in "%s/yaml%stagged_deprecated.yml".', self::$fixturesPath, \DIRECTORY_SEPARATOR));
12151215

12161216
$loader->load('tagged_deprecated.yml');
12171217
}

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\HttpFoundation\Tests\Session\Storage;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
15+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1616
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
1717
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
1818
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler;
@@ -33,7 +33,7 @@
3333
*/
3434
class NativeSessionStorageTest extends TestCase
3535
{
36-
use ExpectDeprecationTrait;
36+
use ExpectUserDeprecationMessageTrait;
3737

3838
private string $savePath;
3939

@@ -224,7 +224,7 @@ public function testCacheExpireOption()
224224
*/
225225
public function testTransSidTagsOption()
226226
{
227-
$this->expectDeprecation('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "trans_sid_tags" option is deprecated and will be ignored in Symfony 8.0.');
227+
$this->expectUserDeprecationMessage('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "trans_sid_tags" option is deprecated and will be ignored in Symfony 8.0.');
228228

229229
$previousErrorHandler = set_error_handler(function ($errno, $errstr) use (&$previousErrorHandler) {
230230
if ('ini_set(): Usage of session.trans_sid_tags INI setting is deprecated' !== $errstr) {
@@ -370,13 +370,13 @@ public function testSaveHandlesNullSessionGracefully()
370370
*/
371371
public function testPassingDeprecatedOptions()
372372
{
373-
$this->expectDeprecation('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "sid_length" option is deprecated and will be ignored in Symfony 8.0.');
374-
$this->expectDeprecation('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "sid_bits_per_character" option is deprecated and will be ignored in Symfony 8.0.');
375-
$this->expectDeprecation('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "referer_check" option is deprecated and will be ignored in Symfony 8.0.');
376-
$this->expectDeprecation('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "use_only_cookies" option is deprecated and will be ignored in Symfony 8.0.');
377-
$this->expectDeprecation('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "use_trans_sid" option is deprecated and will be ignored in Symfony 8.0.');
378-
$this->expectDeprecation('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "trans_sid_hosts" option is deprecated and will be ignored in Symfony 8.0.');
379-
$this->expectDeprecation('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "trans_sid_tags" option is deprecated and will be ignored in Symfony 8.0.');
373+
$this->expectUserDeprecationMessage('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "sid_length" option is deprecated and will be ignored in Symfony 8.0.');
374+
$this->expectUserDeprecationMessage('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "sid_bits_per_character" option is deprecated and will be ignored in Symfony 8.0.');
375+
$this->expectUserDeprecationMessage('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "referer_check" option is deprecated and will be ignored in Symfony 8.0.');
376+
$this->expectUserDeprecationMessage('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "use_only_cookies" option is deprecated and will be ignored in Symfony 8.0.');
377+
$this->expectUserDeprecationMessage('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "use_trans_sid" option is deprecated and will be ignored in Symfony 8.0.');
378+
$this->expectUserDeprecationMessage('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "trans_sid_hosts" option is deprecated and will be ignored in Symfony 8.0.');
379+
$this->expectUserDeprecationMessage('Since symfony/http-foundation 7.2: NativeSessionStorage\'s "trans_sid_tags" option is deprecated and will be ignored in Symfony 8.0.');
380380

381381
$this->getStorage([
382382
'sid_length' => 42,

src/Symfony/Component/Serializer/Tests/Context/Encoder/CsvEncoderContextBuilderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\Serializer\Tests\Context\Encoder;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
15+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1616
use Symfony\Component\Serializer\Context\Encoder\CsvEncoderContextBuilder;
1717
use Symfony\Component\Serializer\Encoder\CsvEncoder;
1818
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
@@ -22,7 +22,7 @@
2222
*/
2323
class CsvEncoderContextBuilderTest extends TestCase
2424
{
25-
use ExpectDeprecationTrait;
25+
use ExpectUserDeprecationMessageTrait;
2626

2727
private CsvEncoderContextBuilder $contextBuilder;
2828

@@ -127,7 +127,7 @@ public function testCannotSetMultipleBytesAsEnclosure()
127127
*/
128128
public function testCannotSetMultipleBytesAsEscapeChar()
129129
{
130-
$this->expectDeprecation('Since symfony/serializer 7.2: The "Symfony\Component\Serializer\Context\Encoder\CsvEncoderContextBuilder::withEscapeChar" method is deprecated. It will be removed in 8.0.');
130+
$this->expectUserDeprecationMessage('Since symfony/serializer 7.2: The "Symfony\Component\Serializer\Context\Encoder\CsvEncoderContextBuilder::withEscapeChar" method is deprecated. It will be removed in 8.0.');
131131

132132
$this->expectException(InvalidArgumentException::class);
133133
$this->contextBuilder->withEscapeChar('');
@@ -138,7 +138,7 @@ public function testCannotSetMultipleBytesAsEscapeChar()
138138
*/
139139
public function testWithEscapeCharIsDeprecated()
140140
{
141-
$this->expectDeprecation('Since symfony/serializer 7.2: The "Symfony\Component\Serializer\Context\Encoder\CsvEncoderContextBuilder::withEscapeChar" method is deprecated. It will be removed in 8.0.');
141+
$this->expectUserDeprecationMessage('Since symfony/serializer 7.2: The "Symfony\Component\Serializer\Context\Encoder\CsvEncoderContextBuilder::withEscapeChar" method is deprecated. It will be removed in 8.0.');
142142
$context = $this->contextBuilder->withEscapeChar('\\');
143143

144144
$this->assertSame(['csv_escape_char' => '\\'], $context->toArray());

src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\Serializer\Tests\Encoder;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
15+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1616
use Symfony\Component\Serializer\Encoder\CsvEncoder;
1717
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
1818

@@ -21,7 +21,7 @@
2121
*/
2222
class CsvEncoderTest extends TestCase
2323
{
24-
use ExpectDeprecationTrait;
24+
use ExpectUserDeprecationMessageTrait;
2525

2626
private CsvEncoder $encoder;
2727

@@ -713,7 +713,7 @@ public function testEndOfLinePassedInConstructor()
713713
*/
714714
public function testPassingNonEmptyEscapeCharIsDeprecated()
715715
{
716-
$this->expectDeprecation('Since symfony/serializer 7.2: Setting the "csv_escape_char" option is deprecated. The option will be removed in 8.0.');
716+
$this->expectUserDeprecationMessage('Since symfony/serializer 7.2: Setting the "csv_escape_char" option is deprecated. The option will be removed in 8.0.');
717717
$encoder = new CsvEncoder(['csv_escape_char' => '@']);
718718

719719
$this->assertSame(

src/Symfony/Component/Translation/Tests/Loader/CsvFileLoaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
namespace Symfony\Component\Translation\Tests\Loader;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
15+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1616
use Symfony\Component\Config\Resource\FileResource;
1717
use Symfony\Component\Translation\Exception\InvalidResourceException;
1818
use Symfony\Component\Translation\Exception\NotFoundResourceException;
1919
use Symfony\Component\Translation\Loader\CsvFileLoader;
2020

2121
class CsvFileLoaderTest extends TestCase
2222
{
23-
use ExpectDeprecationTrait;
23+
use ExpectUserDeprecationMessageTrait;
2424

2525
public function testLoad()
2626
{
@@ -65,7 +65,7 @@ public function testEscapeCharInCsvControlIsDeprecated()
6565
{
6666
$loader = new CsvFileLoader();
6767

68-
$this->expectDeprecation('Since symfony/translation 7.2: The "escape" parameter of the "Symfony\Component\Translation\Loader\CsvFileLoader::setCsvControl" method is deprecated. It will be removed in 8.0.');
68+
$this->expectUserDeprecationMessage('Since symfony/translation 7.2: The "escape" parameter of the "Symfony\Component\Translation\Loader\CsvFileLoader::setCsvControl" method is deprecated. It will be removed in 8.0.');
6969
$loader->setCsvControl(';', '"', '\\');
7070
}
7171
}

0 commit comments

Comments
 (0)
0