예제 #1
0
 /**
  * Test transformAliasDomain().
  *
  * @param Domain $domain
  *
  * @dataProvider domainProvider
  */
 public function testTransformAliasDomain(Domain $domain)
 {
     $new = DomainAliasTransformer::transformAliasDomain($domain);
     if ($domain->getParent() === null) {
         $this->assertEquals($domain->getPath(), $new->getPath());
     } else {
         $this->assertNotEquals($domain->getPath(), $new->getPath());
         $this->assertEquals($domain->getDomain(), $new->getDomain());
         $this->assertEquals($domain->getCertificate()->getName(), $new->getCertificate()->getName());
     }
 }
예제 #2
0
 /**
  * Collect vhost models.
  */
 public function collectVhostModels()
 {
     /*
      * Add domains.
      */
     foreach ($this->getDomains() as $domain) {
         $domain = DomainAliasTransformer::transformAliasDomain($domain);
         $vhosts = DomainTransformer::transformDomain($domain);
         foreach ($vhosts as $vhost) {
             $this->addVhost($vhost);
         }
     }
     /*
      * Add subdomains.
      */
     foreach ($this->getSubdomains() as $subdomain) {
         $subdomain = DomainAliasTransformer::transformAliasSubdomain($subdomain);
         $vhosts = DomainTransformer::transformDomain($subdomain->getDomain(), $subdomain);
         foreach ($vhosts as $vhost) {
             $this->addVhost($vhost);
         }
     }
     $this->sortVhosts();
 }