Exemple #1
0
 function __construct(BackendSingletonContainer $container, $localPart, AddressLibrary $addressLibrary)
 {
     $this->container = $container;
     $this->observerLibrary = new ObserverLibraryImpl($this);
     $this->addressLibrary = $addressLibrary;
     $this->database = $container->getDBInstance();
     $this->localPart = $localPart;
     $this->domainName = $addressLibrary->getDomain()->getDomainName();
     $this->userLibrary = $container->getUserLibraryInstance();
 }
 protected 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->mailPass = self::$mailMySQLOptions->getPassword();
     $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->userLibrary = new UserLibraryImpl($this->container);
     $this->container->setUserLibraryInstance($this->userLibrary);
     $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->address2 = $this->addressLibrary->getAddress('test2');
     $this->nonExistingAddress = $this->createAddress('test3');
     $this->owner1 = $this->userLibrary->getUser('owner1');
     $this->owner2 = $this->userLibrary->getUser('owner2');
 }