8000 :recycle: Update tests · symfony/symfony@231ea41 · GitHub
[go: up one dir, main page]

Skip to content

Commit 231ea41

Browse files
♻️ Update tests
1 parent 399ded3 commit 231ea41

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/Symfony/Component/Notifier/Bridge/Infobip/Tests/InfobipTransportFactoryTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class InfobipTransportFactoryTest extends TestCase
2121
{
2222
public function testCreateWithDsn(): void
2323
{
24-
$factory = $this->initFactory();
24+
$factory = new InfobipTransportFactory();
2525

2626
$dsn = 'infobip://authtoken@default?from=0611223344';
2727
$transport = $factory->create(Dsn::fromString($dsn));
@@ -32,7 +32,7 @@ public function testCreateWithDsn(): void
3232

3333
public function testCreateWithNoFromThrowsMalformed(): void
3434
{
35-
$factory = $this->initFactory();
35+
$factory = new InfobipTransportFactory();
3636

3737
$this->expectException(IncompleteDsnException::class);
3838

@@ -42,7 +42,7 @@ public function testCreateWithNoFromThrowsMalformed(): void
4242

4343
public function testSupportsInfobipScheme(): void
4444
{
45-
$factory = $this->initFactory();
45+
$factory = new InfobipTransportFactory();
4646

4747
$dsn = 'infobip://authtoken@default?from=0611223344';
4848
$dsnUnsupported = 'unsupported://authtoken@default?from=0611223344';
@@ -53,16 +53,11 @@ public function testSupportsInfobipScheme(): void
5353

5454
public function testNonInfobipSchemeThrows(): void
5555
{
56-
$factory = $this->initFactory();
56+
$factory = new InfobipTransportFactory();
5757

5858
$this->expectException(UnsupportedSchemeException::class);
5959

6060
$dsnUnsupported = 'unsupported://authtoken@default?from=0611223344';
6161
$factory->create(Dsn::fromString($dsnUnsupported));
6262
}
63-
64-
private function initFactory(): InfobipTransportFactory
65-
{
66-
return new InfobipTransportFactory();
67-
}
6863
}

src/Symfony/Component/Notifier/Bridge/Infobip/Tests/InfobipTransportTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,34 @@ final class InfobipTransportTest extends TestCase
2222
{
2323
public function testToStringContainsProperties(): void
2424
{
25 F277 -
$transport = $this->initTransport();
25+
$transport = $this->getTransport();
2626

2727
$this->assertSame('infobip://host.test?from=0611223344', (string) $transport);
2828
}
2929

3030
public function testSupportsMessageInterface(): void
3131
{
32-
$transport = $this->initTransport();
32+
$transport = $this->getTransport();
3333

3434
$this->assertTrue($transport->supports(new SmsMessage('0611223344', 'Hello!')));
3535
$this->assertFalse($transport->supports($this->createMock(MessageInterface::class), 'Hello!'));
3636
}
3737

3838
public function testSendNonSmsMessageThrowsException(): void
3939
{
40-
$transport = $this->initTransport();
40+
$transport = $this->getTransport();
4141

4242
$this->expectException(LogicException::class);
4343

4444
$transport->send($this->createMock(MessageInterface::class));
4545
}
4646

47-
private function initTransport(): InfobipTransport
47+
private function getTransport(): InfobipTransport
4848
{
4949
return (new InfobipTransport(
50-
'authtoken', '0611223344', $this->createMock(HttpClientInterface::class)
50+
'authtoken',
51+
'0611223344',
52+
$this->createMock(HttpClientInterface::class)
5153
))->setHost('host.test');
5254
}
5355
}

0 commit comments

Comments
 (0)
0