public function testCreateService() { $sm = ServiceManagerFactory::getServiceManager(); $factory = new MailPhpRendererFactory(); $options = $factory->createService($sm, 'goaliomailservicerenderer'); $this->assertInstanceOf('Zend\\View\\Renderer\\PhpRenderer', $options); }
public function testCreateService() { $sm = ServiceManagerFactory::getServiceManager(); $factory = new TransportOptionsFactory(); $options = $factory->createService($sm, 'goaliomailserviceoptions', 'GoalioMailServiceTest\\Mail\\Options\\TransportOptions'); $this->assertInstanceOf('GoalioMailService\\Mail\\Options\\TransportOptions', $options); }
/** * @expectedException Exception */ public function testServiceThrowsExceptionWhenTransportClassNotExists() { $sm = ServiceManagerFactory::getServiceManager(); $options = $sm->get('goaliomailservice_options'); $options->setTransportClass('DoesNotExist'); $transport = $sm->get('goaliomailservice_transport'); }
public function testSetGetServiceManager() { $sm = ServiceManagerFactory::getServiceManager(); $this->message->setServiceManager($sm); $this->assertEquals($sm, $this->message->getServiceManager()); }
<?php chdir(__DIR__); $loader = null; if (file_exists('../vendor/autoload.php')) { $loader = (include '../vendor/autoload.php'); } elseif (file_exists('../../../autoload.php')) { $loader = (include '../../../autoload.php'); } else { throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?'); } $loader->add('GoalioMailServiceTest', __DIR__); if (!($config = @(include 'configuration.php'))) { $config = (require 'configuration.php.dist'); } \GoalioMailServiceTest\Util\ServiceManagerFactory::setConfig($config);