Skip to content

Commit 2b8200a

Browse files
committed
fix some tests
1 parent fe40c85 commit 2b8200a

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/Symfony/Component/Mailer/Bridge/Google/Tests/GmailTransportFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public function createProvider(): iterable
4141

4242
public function unsupportedSchemeProvider(): iterable
4343
{
44-
yield [new Dsn('api', 'gmail', null, self::USER, self::PASS)];
44+
yield [new Dsn('http', 'gmail', null, self::USER, self::PASS)];
4545
}
4646
}

src/Symfony/Component/Mailer/Tests/Transport/SendmailTransportFactoryTest.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,42 @@
1111

1212
namespace Symfony\Component\Mailer\Tests\Transport;
1313

14+
use Symfony\Component\Mailer\Bridge\Sendgrid\Factory\SendgridTransportFactory;
1415
use Symfony\Component\Mailer\Tests\TransportFactoryTestCase;
16+
use Symfony\Component\Mailer\Transport\Dsn;
17+
use Symfony\Component\Mailer\Transport\SendmailTransport;
1518
use Symfony\Component\Mailer\Transport\TransportFactoryInterface;
1619

1720
class SendmailTransportFactoryTest extends TransportFactoryTestCase
1821
{
1922
public function getFactory(): TransportFactoryInterface
2023
{
21-
// TODO: Implement getFactory() method.
24+
return new SendgridTransportFactory($this->eventDispatcher, $this->httpClient, $this->logger);
2225
}
2326

2427
public function supportsProvider(): iterable
2528
{
26-
// TODO: Implement supportsProvider() method.
29+
yield [
30+
new Dsn('smtp', 'sendmail', null, null, null),
31+
true,
32+
];
33+
34+
yield [
35+
new Dsn('smtp', 'dummy', null, null, null),
36+
false,
37+
];
2738
}
2839

2940
public function createProvider(): iterable
3041
{
31-
// TODO: Implement createProvider() method.
42+
yield [
43+
new Dsn('smtp', 'sendmail', null, null, null),
44+
new SendmailTransport(null, $this->eventDispatcher, $this->logger),
45+
];
3246
}
3347

3448
public function unsupportedSchemeProvider(): iterable
3549
{
36-
// TODO: Implement unsupportedSchemeProvider() method.
50+
yield [new Dsn('http', 'sendmail', null, null, null)];
3751
}
3852
}

src/Symfony/Component/Mailer/Tests/TransportFactoryTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testUnsupportedSchemeException(Dsn $dsn): void
6060
{
6161
$factory = $this->getFactory();
6262

63-
$this->expectsException(UnsupportedSchemeException::class);
63+
$this->expectException(UnsupportedSchemeException::class);
6464
$factory->create($dsn);
6565
}
6666

src/Symfony/Component/Mailer/Tests/TransportTest.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,6 @@ public function testFromInvalidTransportName()
6262
Transport::fromDsn('api://foobar');
6363
}
6464

65-
public function testFromDsnGmail()
66-
{
67-
$dispatcher = $this->createMock(EventDispatcherInterface::class);
68-
$logger = $this->createMock(LoggerInterface::class);
69-
$transport = Transport::fromDsn('smtp://'.urlencode('u$er').':'.urlencode('pa$s').'@gmail', $dispatcher, null, $logger);
70-
$this->assertInstanceOf(Google\Smtp\GmailTransport::class, $transport);
71-
$this->assertEquals('u$er', $transport->getUsername());
72-
$this->assertEquals('pa$s', $transport->getPassword());
73-
$this->assertProperties($transport, $dispatcher, $logger);
74-
75-
$this->expectException(LogicException::class);
76-
Transport::fromDsn('http://gmail');
77-
}
78-
7965
public function testFromDsnMailgun()
8066
{
8167
$dispatcher = $this->createMock(EventDispatcherInterface::class);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy