Пример #1
0
 /**
  * Test getProtectionForDocumentRoot().
  */
 public function testGetProtectionForDocumentRoot()
 {
     $vhost = new Vhost();
     $domain = new Domain();
     $protection1 = new Protection($domain);
     $protection2 = new Protection($domain);
     $domain->setPath('/var/www/domain.de')->setWebroot('htdocs');
     $domain->getProtection()->add($protection1);
     $domain->getProtection()->add($protection2);
     $protection2->setPath('htdocs/test');
     $protection1->setPath('htdocs');
     $vhost->setDomain($domain);
     $this->assertEquals($protection1, $vhost->getProtectionForDocumentRoot());
     $domain->getProtection()->removeElement($protection1);
     $this->assertNull($vhost->getProtectionForDocumentRoot());
 }