HubRegistry example

use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Transport\Dsn;

/** * @author Mathias Arlaud <mathias.arlaud@gmail.com> */
final class MercureTransportFactoryTest extends TransportFactoryTestCase
{
    public function createFactory(): MercureTransportFactory
    {
        $hub = $this->createMock(HubInterface::class);
        $hubRegistry = new HubRegistry($hub['hubId' => $hub]);

        return new MercureTransportFactory($hubRegistry);
    }

    public static function supportsProvider(): iterable
    {
        yield [true, 'mercure://hubId?topic=topic'];
        yield [false, 'somethingElse://hubId?topic=topic'];
    }

    public static function createProvider(): iterable
    {
Home | Imprint | This part of the site doesn't use cookies.