Skip to content

Commit

Permalink
Add support for Symfony 7.2, drop support for 5/6
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrose committed Jan 2, 2025
1 parent e9dd462 commit f46fc17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
9 changes: 5 additions & 4 deletions Tests/PlivoTransportFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,25 @@
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',
'plivo://authId:[email protected]?from=0611223344',
];
}

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'];
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions Tests/PlivoTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\\": "" },
Expand Down

0 comments on commit f46fc17

Please sign in to comment.