minor #39453 [Notifier] Remove void return type from test methods (OskarStark)

This PR was merged into the 5.1 branch.

Discussion
----------

[Notifier] Remove void return type from test methods

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| New feature?  | no
| Deprecations? | no
| Tickets       | ---
| License       | MIT
| Doc PR        | ---

cc @nicolas-grekas

Commits
-------

616df0c6a3 [Notifier] Remove void return type from test methods
This commit is contained in:
Nicolas Grekas 2020-12-11 11:31:38 +01:00
commit 134af39538
7 changed files with 35 additions and 35 deletions

View File

@ -19,7 +19,7 @@ use Symfony\Component\Notifier\Transport\Dsn;
final class FreeMobileTransportFactoryTest extends TestCase
{
public function testCreateWithDsn(): void
public function testCreateWithDsn()
{
$factory = $this->createFactory();
@ -30,7 +30,7 @@ final class FreeMobileTransportFactoryTest extends TestCase
$this->assertSame('freemobile://host.test?phone=0611223344', (string) $transport);
}
public function testCreateWithNoPhoneThrowsMalformed(): void
public function testCreateWithNoPhoneThrowsMalformed()
{
$factory = $this->createFactory();
@ -40,7 +40,7 @@ final class FreeMobileTransportFactoryTest extends TestCase
$factory->create(Dsn::fromString($dsnIncomplete));
}
public function testSupportsFreeMobileScheme(): void
public function testSupportsFreeMobileScheme()
{
$factory = $this->createFactory();
@ -51,7 +51,7 @@ final class FreeMobileTransportFactoryTest extends TestCase
$this->assertFalse($factory->supports(Dsn::fromString($dsnUnsupported)));
}
public function testNonFreeMobileSchemeThrows(): void
public function testNonFreeMobileSchemeThrows()
{
$factory = $this->createFactory();

View File

@ -20,14 +20,14 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
final class FreeMobileTransportTest extends TestCase
{
public function testToStringContainsProperties(): void
public function testToStringContainsProperties()
{
$transport = $this->initTransport();
$this->assertSame('freemobile://host.test?phone=0611223344', (string) $transport);
}
public function testSupportsMessageInterface(): void
public function testSupportsMessageInterface()
{
$transport = $this->initTransport();
@ -36,7 +36,7 @@ final class FreeMobileTransportTest extends TestCase
$this->assertFalse($transport->supports($this->createMock(MessageInterface::class)));
}
public function testSendNonSmsMessageThrowsException(): void
public function testSendNonSmsMessageThrowsException()
{
$transport = $this->initTransport();
@ -45,7 +45,7 @@ final class FreeMobileTransportTest extends TestCase
$transport->send($this->createMock(MessageInterface::class));
}
public function testSendSmsMessageButInvalidPhoneThrowsException(): void
public function testSendSmsMessageButInvalidPhoneThrowsException()
{
$transport = $this->initTransport();

View File

@ -26,7 +26,7 @@ use Symfony\Contracts\HttpClient\ResponseInterface;
final class SlackTransportTest extends TestCase
{
public function testToStringContainsProperties(): void
public function testToStringContainsProperties()
{
$host = 'testHost';
$path = 'testPath';
@ -37,7 +37,7 @@ final class SlackTransportTest extends TestCase
$this->assertSame(sprintf('slack://%s/%s', $host, $path), (string) $transport);
}
public function testSupportsChatMessage(): void
public function testSupportsChatMessage()
{
$transport = new SlackTransport('testPath', $this->createMock(HttpClientInterface::class));
@ -45,7 +45,7 @@ final class SlackTransportTest extends TestCase
$this->assertFalse($transport->supports($this->createMock(MessageInterface::class)));
}
public function testSendNonChatMessageThrows(): void
public function testSendNonChatMessageThrows()
{
$this->expectException(LogicException::class);
@ -54,7 +54,7 @@ final class SlackTransportTest extends TestCase
$transport->send($this->createMock(MessageInterface::class));
}
public function testSendWithEmptyArrayResponseThrows(): void
public function testSendWithEmptyArrayResponseThrows()
{
$this->expectException(TransportException::class);
@ -75,7 +75,7 @@ final class SlackTransportTest extends TestCase
$transport->send(new ChatMessage('testMessage'));
}
public function testSendWithErrorResponseThrows(): void
public function testSendWithErrorResponseThrows()
{
$this->expectException(TransportException::class);
$this->expectExceptionMessage('testErrorCode');
@ -98,7 +98,7 @@ final class SlackTransportTest extends TestCase
$transport->send(new ChatMessage('testMessage'));
}
public function testSendWithOptions(): void
public function testSendWithOptions()
{
$path = 'testPath';
$message = 'testMessage';
@ -126,7 +126,7 @@ final class SlackTransportTest extends TestCase
$transport->send(new ChatMessage('testMessage'));
}
public function testSendWithNotification(): void
public function testSendWithNotification()
{
$host = 'testHost';
$message = 'testMessage';
@ -161,7 +161,7 @@ final class SlackTransportTest extends TestCase
$transport->send($chatMessage);
}
public function testSendWithInvalidOptions(): void
public function testSendWithInvalidOptions()
{
$this->expectException(LogicException::class);
@ -174,7 +174,7 @@ final class SlackTransportTest extends TestCase
$transport->send(new ChatMessage('testMessage', $this->createMock(MessageOptionsInterface::class)));
}
public function testSendWith200ResponseButNotOk(): void
public function testSendWith200ResponseButNotOk()
{
$host = 'testChannel';
$message = 'testMessage';

View File

@ -19,7 +19,7 @@ use Symfony\Component\Notifier\Transport\Dsn;
final class TelegramTransportFactoryTest extends TestCase
{
public function testCreateWithDsn(): void
public function testCreateWithDsn()
{
$factory = new TelegramTransportFactory();
@ -31,7 +31,7 @@ final class TelegramTransportFactoryTest extends TestCase
$this->assertSame(sprintf('telegram://%s?channel=%s', $host, $channel), (string) $transport);
}
public function testCreateWithNoPasswordThrowsMalformed(): void
public function testCreateWithNoPasswordThrowsMalformed()
{
$factory = new TelegramTransportFactory();
@ -39,7 +39,7 @@ final class TelegramTransportFactoryTest extends TestCase
$factory->create(Dsn::fromString(sprintf('telegram://%s@%s/?channel=%s', 'simpleToken', 'testHost', 'testChannel')));
}
public function testCreateWithNoTokenThrowsMalformed(): void
public function testCreateWithNoTokenThrowsMalformed()
{
$factory = new TelegramTransportFactory();
@ -47,7 +47,7 @@ final class TelegramTransportFactoryTest extends TestCase
$factory->create(Dsn::fromString(sprintf('telegram://%s/?channel=%s', 'testHost', 'testChannel')));
}
public function testSupportsTelegramScheme(): void
public function testSupportsTelegramScheme()
{
$factory = new TelegramTransportFactory();
@ -55,7 +55,7 @@ final class TelegramTransportFactoryTest extends TestCase
$this->assertFalse($factory->supports(Dsn::fromString('somethingElse://host/?channel=testChannel')));
}
public function testNonTelegramSchemeThrows(): void
public function testNonTelegramSchemeThrows()
{
$factory = new TelegramTransportFactory();

View File

@ -24,7 +24,7 @@ use Symfony\Contracts\HttpClient\ResponseInterface;
final class TelegramTransportTest extends TestCase
{
public function testToStringContainsProperties(): void
public function testToStringContainsProperties()
{
$channel = 'testChannel';
@ -34,7 +34,7 @@ final class TelegramTransportTest extends TestCase
$this->assertSame(sprintf('telegram://%s?channel=%s', 'testHost', $channel), (string) $transport);
}
public function testSupportsChatMessage(): void
public function testSupportsChatMessage()
{
$transport = new TelegramTransport('testToken', 'testChannel', $this->createMock(HttpClientInterface::class));
@ -42,7 +42,7 @@ final class TelegramTransportTest extends TestCase
$this->assertFalse($transport->supports($this->createMock(MessageInterface::class)));
}
public function testSendNonChatMessageThrows(): void
public function testSendNonChatMessageThrows()
{
$this->expectException(LogicException::class);
$transport = new TelegramTransport('testToken', 'testChannel', $this->createMock(HttpClientInterface::class));
@ -50,7 +50,7 @@ final class TelegramTransportTest extends TestCase
$transport->send($this->createMock(MessageInterface::class));
}
public function testSendWithErrorResponseThrows(): void
public function testSendWithErrorResponseThrows()
{
$this->expectException(TransportException::class);
$this->expectExceptionMessageMatches('/testDescription.+testErrorCode/');
@ -72,7 +72,7 @@ final class TelegramTransportTest extends TestCase
$transport->send(new ChatMessage('testMessage'));
}
public function testSendWithOptions(): void
public function testSendWithOptions()
{
$channel = 'testChannel';
@ -101,7 +101,7 @@ final class TelegramTransportTest extends TestCase
$transport->send(new ChatMessage('testMessage'));
}
public function testSendWithChannelOverride(): void
public function testSendWithChannelOverride()
{
$channelOverride = 'channelOverride';

View File

@ -19,7 +19,7 @@ use Symfony\Component\Notifier\Transport\Dsn;
final class TwilioTransportFactoryTest extends TestCase
{
public function testCreateWithDsn(): void
public function testCreateWithDsn()
{
$factory = $this->createFactory();
@ -30,7 +30,7 @@ final class TwilioTransportFactoryTest extends TestCase
$this->assertSame('twilio://host.test?from=0611223344', (string) $transport);
}
public function testCreateWithNoFromThrowsMalformed(): void
public function testCreateWithNoFromThrowsMalformed()
{
$factory = $this->createFactory();
@ -40,7 +40,7 @@ final class TwilioTransportFactoryTest extends TestCase
$factory->create(Dsn::fromString($dsnIncomplete));
}
public function testSupportsTwilioScheme(): void
public function testSupportsTwilioScheme()
{
$factory = $this->createFactory();
@ -51,7 +51,7 @@ final class TwilioTransportFactoryTest extends TestCase
$this->assertFalse($factory->supports(Dsn::fromString($dsnUnsupported)));
}
public function testNonTwilioSchemeThrows(): void
public function testNonTwilioSchemeThrows()
{
$factory = $this->createFactory();

View File

@ -20,14 +20,14 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
final class TwilioTransportTest extends TestCase
{
public function testToStringContainsProperties(): void
public function testToStringContainsProperties()
{
$transport = $this->createTransport();
$this->assertSame('twilio://host.test?from=sender', (string) $transport);
}
public function testSupportsMessageInterface(): void
public function testSupportsMessageInterface()
{
$transport = $this->createTransport();
@ -35,7 +35,7 @@ final class TwilioTransportTest extends TestCase
$this->assertFalse($transport->supports($this->createMock(MessageInterface::class)));
}
public function testSendNonSmsMessageThrowsException(): void
public function testSendNonSmsMessageThrowsException()
{
$transport = $this->createTransport();