/** * Test getCertificate(). */ public function testGetCertificate() { $domain = new Domain(); $subdomain = new Subdomain($domain); $vhost = new Vhost(); $certA = new Certificate(); $certB = new Certificate(); $ip = new IpAddress(); $ip->setHasSsl(true); $vhost->setDomain($domain)->setIpaddress($ip); $subdomain->setCertificate($certA); $certA->setName('A'); $certB->setName('B'); $this->assertNull($vhost->getCertificate()); $domain->setCertificate($certB); $this->assertEquals('B', $vhost->getCertificate()->getName()); $vhost->setSubdomain($subdomain); $this->assertEquals('A', $vhost->getCertificate()->getName()); }