From f46fc1709a472f2bad3c797205b13eed2107b979 Mon Sep 17 00:00:00 2001 From: Thomas Rose Date: Thu, 2 Jan 2025 13:09:59 +1100 Subject: [PATCH] Add support for Symfony 7.2, drop support for 5/6 --- Tests/PlivoTransportFactoryTest.php | 9 +++++---- Tests/PlivoTransportTest.php | 14 +++++++------- composer.json | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Tests/PlivoTransportFactoryTest.php b/Tests/PlivoTransportFactoryTest.php index ea9a2b0..434eedc 100644 --- a/Tests/PlivoTransportFactoryTest.php +++ b/Tests/PlivoTransportFactoryTest.php @@ -12,16 +12,17 @@ namespace Symfony\Component\Notifier\Bridge\Plivo\Tests; use Symfony\Component\Notifier\Bridge\Plivo\PlivoTransportFactory; +use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase; use Symfony\Component\Notifier\Test\TransportFactoryTestCase; -final class PlivoTransportFactoryTest extends TransportFactoryTestCase +final class PlivoTransportFactoryTest extends AbstractTransportFactoryTestCase { public function createFactory(): PlivoTransportFactory { return new PlivoTransportFactory(); } - public function createProvider(): iterable + public static function createProvider(): iterable { yield [ 'plivo://host.test?from=0611223344', @@ -29,7 +30,7 @@ public function createProvider(): iterable ]; } - public function supportsProvider(): iterable + public static function supportsProvider(): iterable { yield [true, 'plivo://authId:authToken@default?from=0611223344']; yield [false, 'somethingElse://authId:authToken@default?from=0611223344']; @@ -40,7 +41,7 @@ public function missingRequiredOptionProvider(): iterable yield 'missing option: from' => ['plivo://authId:authToken@default']; } - public function unsupportedSchemeProvider(): iterable + public static function unsupportedSchemeProvider(): iterable { yield ['somethingElse://authId:authToken@default?from=0611223344']; yield ['somethingElse://authId:authToken@default']; // missing "from" option diff --git a/Tests/PlivoTransportTest.php b/Tests/PlivoTransportTest.php index 0ccff4c..81a2a95 100644 --- a/Tests/PlivoTransportTest.php +++ b/Tests/PlivoTransportTest.php @@ -23,25 +23,25 @@ final class PlivoTransportTest extends TransportTestCase { - public function createTransport(HttpClientInterface $client = null, string $from = 'from'): PlivoTransport + public static function createTransport(HttpClientInterface $client = null, string $from = 'from'): PlivoTransport { - return new PlivoTransport('authId', 'authToken', $from, 'https://localhost/status', null, $client ?? $this->createMock(HttpClientInterface::class)); + return new PlivoTransport('authId', 'authToken', $from, 'https://localhost/status', null, $client ?? (new self())->createMock(HttpClientInterface::class)); } - public function toStringProvider(): iterable + public static function toStringProvider(): iterable { - yield ['plivo://api.plivo.com?from=from', $this->createTransport()]; + yield ['plivo://api.plivo.com?from=from', self::createTransport()]; } - public function supportedMessagesProvider(): iterable + public static function supportedMessagesProvider(): iterable { yield [new SmsMessage('0611223344', 'Hello!')]; } - public function unsupportedMessagesProvider(): iterable + public static function unsupportedMessagesProvider(): iterable { yield [new ChatMessage('Hello!')]; - yield [$this->createMock(MessageInterface::class)]; + yield [(new self())->createMock(MessageInterface::class)]; } /** diff --git a/composer.json b/composer.json index f3f4fee..4aaa578 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ ], "require": { "php": ">=8.1", - "symfony/http-client": "^5.4|^6.0", - "symfony/notifier": "^5.4|^6.0" + "symfony/http-client": "^7.2", + "symfony/notifier": "^7.2" }, "autoload": { "psr-4": { "Symfony\\Component\\Notifier\\Bridge\\Plivo\\": "" },