Esempio n. 1
0
 /**
  * Provide test-data.
  */
 public function dataProvider()
 {
     $certificate = new Certificate();
     $domainWithoutIp = new Domain();
     $domainWithoutIp->setDomain('withoutIp.de');
     $ipaddressWithSSL = new IpAddress();
     $ipaddressWithSSL->setHasSsl(true);
     $ipaddressWithoutSSL = new IpAddress();
     $ipaddressWithoutSSL->setHasSsl(false);
     $domainWithIPs = new Domain();
     $domainWithIPs->setDomain('withIp.de')->setIpaddress(new ArrayCollection(array($ipaddressWithoutSSL, $ipaddressWithSSL)))->setCertificate($certificate);
     $subdomainWithSSL = new Subdomain($domainWithIPs);
     $subdomainWithSSL->setCertificate($certificate)->setSubdomain('withssl');
     $subdomainWithSSL2 = new Subdomain($domainWithoutIp);
     $subdomainWithSSL2->setCertificate($certificate)->setSubdomain('withssl');
     $subdomainWithoutSSL = new Subdomain($domainWithIPs);
     $subdomainWithoutSSL->setSubdomain('withoutssl');
     $subdomainWithoutSSL2 = new Subdomain($domainWithoutIp);
     $subdomainWithoutSSL2->setSubdomain('withoutssl');
     return array(array($domainWithIPs, $subdomainWithoutSSL), array($domainWithIPs, $subdomainWithSSL), array($domainWithoutIp, $subdomainWithSSL2), array($domainWithoutIp, $subdomainWithoutSSL2), array($domainWithIPs), array($domainWithoutIp));
 }
Esempio n. 2
0
 /**
  * Test getForceSSL().
  */
 public function testGetForceSSL()
 {
     $domain = new Domain();
     $vhost = new Vhost();
     $certificate = new Certificate();
     $subdomain = new Subdomain($domain);
     $ip = new IpAddress();
     $certificate->setName('test')->setCertificateFile('asdasdasdds');
     $domain->setCertificate($certificate)->setForceSsl(true);
     $subdomain->setCertificate($certificate)->setForceSsl(true);
     $vhost->setDomain($domain);
     $this->assertTrue($vhost->getForceSSL());
     $vhost->setSubdomain($subdomain);
     $this->assertTrue($vhost->getForceSSL());
     $ip->setHasSsl(true);
     $vhost->setIpaddress($ip);
     $this->assertFalse($vhost->getForceSSL());
 }