Common\Tests\Mailer\ConfiguratorTest::testConfiguratorSetsSmtpTransport PHP Метод

testConfiguratorSetsSmtpTransport() публичный Метод

    public function testConfiguratorSetsSmtpTransport()
    {
        $modulesSettingsMock = $this->getModulesSettingsMock();
        $containerMock = $this->getContainerMock();
        $configurator = new Configurator($modulesSettingsMock, $containerMock);
        // always return null: we have modules settings set for smtp
        $modulesSettingsMock->expects($this->exactly(6))->method('get')->will($this->onConsecutiveCalls('smtp', 'test.server.com', 25, '[email protected]', 'testpass'));
        // we want our set method to be called with a Smtp transport
        $containerMock->expects($this->once())->method('set')->with($this->equalTo('swiftmailer.mailer.default.transport'), $this->isInstanceOf('\\Swift_SmtpTransport'));
        $configurator->onKernelRequest($this->getGetResponseEventMock());
    }