public function testCreateFromFactory() { $transport = ServiceManagerFactory::getServiceManager()->get('EzMail\\Mail\\Transport\\PostageTransport'); $this->assertInstanceOf('EzMail\\Mail\\Transport\\HttpTransport', $transport); $property = new \ReflectionProperty('EzMail\\Mail\\Transport\\HttpTransport', 'service'); $property->setAccessible(true); $this->assertInstanceOf('EzMail\\Service\\PostageService', $property->getValue($transport)); }
public function testCanSetOptionsForHttpAdapter() { $serviceManager = ServiceManagerFactory::getServiceManager(); $serviceManager->setAllowOverride(true); $config = $serviceManager->get('Config'); $config['ez_mail']['http_options'] = array('sslverifypeer' => false); $serviceManager->setService('Config', $config); /** @var \Zend\Http\Client $client */ $client = $serviceManager->get('EzMail\\Http\\Client'); $config = $client->getAdapter()->getConfig(); $this->assertFalse($config['sslverifypeer']); }
public function testCreateFromFactory() { $serviceManager = ServiceManagerFactory::getServiceManager(); $serviceManager->setAllowOverride(true); $self = $this; $serviceManager->setFactory('Aws', function () use($self) { $aws = $self->getMock('Guzzle\\Service\\Builder\\ServiceBuilderInterface'); $aws->expects($self->once())->method('get')->with($self->equalTo('Ses'))->will($self->returnValue($self->getMock('Aws\\Ses\\SesClient', array(), array(), '', false))); return $aws; }); $transport = $serviceManager->get('EzMail\\Mail\\Transport\\SesTransport'); $this->assertInstanceOf('EzMail\\Mail\\Transport\\HttpTransport', $transport); $property = new \ReflectionProperty('EzMail\\Mail\\Transport\\HttpTransport', 'service'); $property->setAccessible(true); $this->assertInstanceOf('EzMail\\Service\\SesService', $property->getValue($transport)); }
public function testCreateFromFactory() { $service = ServiceManagerFactory::getServiceManager()->get('EzMail\\Service\\MandrillService'); $this->assertInstanceOf('EzMail\\Service\\MandrillService', $service); }