From 5b3e6a53ef4a4f8372a3e1623e5117a542d6c080 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 14 Feb 2023 15:04:49 +0100 Subject: [PATCH] use proper methods to assert exception messages contain certain strings --- src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php | 2 +- .../Mailer/Tests/Transport/NativeTransportFactoryTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php b/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php index 2edbcdfabdc55..621767bf73f0c 100644 --- a/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php +++ b/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php @@ -151,7 +151,7 @@ public function testCreateTableWithoutConsoleOutput() $style = new SymfonyStyle($input, $output); $this->expectException(RuntimeException::class); - $this->expectDeprecationMessage('Output should be an instance of "Symfony\Component\Console\Output\ConsoleSectionOutput"'); + $this->expectExceptionMessage('Output should be an instance of "Symfony\Component\Console\Output\ConsoleSectionOutput"'); $style->createTable()->appendRow(['row']); } diff --git a/src/Symfony/Component/Mailer/Tests/Transport/NativeTransportFactoryTest.php b/src/Symfony/Component/Mailer/Tests/Transport/NativeTransportFactoryTest.php index 495fd8c384955..c253b4c7cb503 100644 --- a/src/Symfony/Component/Mailer/Tests/Transport/NativeTransportFactoryTest.php +++ b/src/Symfony/Component/Mailer/Tests/Transport/NativeTransportFactoryTest.php @@ -47,7 +47,7 @@ function ini_get(\$key) public function testCreateWithNotSupportedScheme() { $this->expectException(UnsupportedSchemeException::class); - $this->expectErrorMessageMatches('#The ".*" scheme is not supported#'); + $this->expectExceptionMessage('The "sendmail" scheme is not supported'); $sut = new NativeTransportFactory(); $sut->create(Dsn::fromString('sendmail://default'));