Files
expense/vendor/symfony/mailer/Test/TransportFactoryTestCase.php
T

65 lines
1.7 KiB
PHP
Raw Normal View History

2024-11-27 11:16:45 +07:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Test;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
* A test case to ease testing Transport Factory.
*
* @author Konstantin Myakshin <molodchick@gmail.com>
2024-12-02 01:18:34 +07:00
*
* @deprecated since Symfony 7.2, use AbstractTransportFactoryTestCase instead
2024-11-27 11:16:45 +07:00
*/
2024-12-02 01:18:34 +07:00
abstract class TransportFactoryTestCase extends AbstractTransportFactoryTestCase
2024-11-27 11:16:45 +07:00
{
2024-12-02 01:18:34 +07:00
use IncompleteDsnTestTrait;
2024-11-27 11:16:45 +07:00
protected EventDispatcherInterface $dispatcher;
protected HttpClientInterface $client;
protected LoggerInterface $logger;
/**
2024-12-02 01:18:34 +07:00
* @psalm-return iterable<array{0: Dsn, 1?: string|null}>
2024-11-27 11:16:45 +07:00
*/
2024-12-02 01:18:34 +07:00
public static function unsupportedSchemeProvider(): iterable
2024-11-27 11:16:45 +07:00
{
2024-12-02 01:18:34 +07:00
return [];
2024-11-27 11:16:45 +07:00
}
/**
2024-12-02 01:18:34 +07:00
* @psalm-return iterable<array{0: Dsn}>
2024-11-27 11:16:45 +07:00
*/
2024-12-02 01:18:34 +07:00
public static function incompleteDsnProvider(): iterable
2024-11-27 11:16:45 +07:00
{
2024-12-02 01:18:34 +07:00
return [];
2024-11-27 11:16:45 +07:00
}
protected function getDispatcher(): EventDispatcherInterface
{
return $this->dispatcher ??= $this->createMock(EventDispatcherInterface::class);
}
protected function getClient(): HttpClientInterface
{
return $this->client ??= $this->createMock(HttpClientInterface::class);
}
protected function getLogger(): LoggerInterface
{
return $this->logger ??= $this->createMock(LoggerInterface::class);
}
}