getSite() public method

Returns the site this domain is pointing to
public getSite ( ) : Site
return Site
 /**
  * @test
  */
 public function setSiteSetsTheSiteTheDomainIsPointingTo()
 {
     /** @var Site $mockSite */
     $mockSite = $this->getMockBuilder(Site::class)->disableOriginalConstructor()->getMock();
     $domain = new Domain();
     $domain->setSite($mockSite);
     $this->assertSame($mockSite, $domain->getSite());
 }
 /**
  * Deletes a domain attached to a site
  *
  * @param Domain $domain A domain to delete
  * @Flow\IgnoreValidation("$domain")
  * @return void
  */
 public function deleteDomainAction(Domain $domain)
 {
     $site = $domain->getSite();
     if ($site->getPrimaryDomain() === $domain) {
         $site->setPrimaryDomain(null);
         $this->siteRepository->update($site);
     }
     $this->domainRepository->remove($domain);
     $this->addFlashMessage('The domain "%s" has been deleted.', 'Domain deleted', Message::SEVERITY_OK, array(htmlspecialchars($domain)), 1412373310);
     $this->unsetLastVisitedNodeAndRedirect('edit', null, null, array('site' => $site));
 }