public function setUp() { parent::setUp(); $this->container = new StubBackendSingletonContainerImpl(); $this->config = new StubConfigImpl(); $this->config->setMailMysqlConnection(array('user' => self::$mailMySQLOptions->getUsername(), 'database' => self::$mailMySQLOptions->getDatabase(), 'host' => self::$mailMySQLOptions->getHost())); $this->config->setMysqlConnection(array('user' => self::$mysqlOptions->getUsername(), 'database' => self::$mysqlOptions->getDatabase(), 'host' => self::$mysqlOptions->getHost(), 'password' => self::$mysqlOptions->getPassword())); $this->container->setConfigInstance($this->config); $this->db = new StubDBImpl(); $this->db->setConnection(self::$pdo); $this->container->setDBInstance($this->db); $this->container->setUserLibraryInstance(new StubUserLibraryImpl()); $this->domainLibrary = new DomainLibraryImpl($this->container); $this->domain = $this->domainLibrary->getDomain('test.dk'); $this->addressLibrary = $this->domain->getAddressLibrary(); $this->address = $this->addressLibrary->getAddress('test'); $this->mailbox = $this->address->getMailbox(); $this->mailbox2 = new MailboxImpl($this->container, $this->address); $this->nonExistingMailbox = new MailboxImpl($this->container, $this->addressLibrary->getAddress('test2')); }
public function testGenerateTypeHandlerReusesInstance() { $this->assertEquals($this->addressLibrary, $this->addressLibrary->generateTypeHandler()); }