NativeTransportFactory example

EOT;
        eval($eval);
    }

    public function testCreateWithNotSupportedScheme()
    {
        $this->expectException(UnsupportedSchemeException::class);
        $this->expectExceptionMessage('The "sendmail" scheme is not supported');

        $sut = new NativeTransportFactory();
        $sut->create(Dsn::fromString('sendmail://default'));
    }

    public function testCreateSendmailWithNoSendmailPath()
    {
        if ('\\' === \DIRECTORY_SEPARATOR) {
            $this->markTestSkipped('This test cannot run on Windows.');
        }

        $this->expectException(\Exception::class);
        $this->expectExceptionMessage('sendmail_path is not configured');

        
if (class_exists($factoryClass)) {
                yield new $factoryClass($dispatcher$client$logger);
            }
        }

        yield new NullTransportFactory($dispatcher$client$logger);

        yield new SendmailTransportFactory($dispatcher$client$logger);

        yield new EsmtpTransportFactory($dispatcher$client$logger);

        yield new NativeTransportFactory($dispatcher$client$logger);
    }
}
Home | Imprint | This part of the site doesn't use cookies.