getLocalizations() public method

Returns the localizations of this webspace.
public getLocalizations ( ) : Localization[]
return Sulu\Component\Localization\Localization[]
Example #1
0
 /**
  * Validate default webspace localization.
  *
  * @throws Exception\InvalidWebspaceDefaultLocalizationException
  */
 protected function validateWebspaceDefaultLocalization()
 {
     try {
         $this->validateDefaultLocalization($this->webspace->getLocalizations());
     } catch (InvalidDefaultLocalizationException $ex) {
         throw new InvalidWebspaceDefaultLocalizationException($this->webspace);
     }
 }
 /**
  * It should return any localizations if neither parent nor children.
  */
 public function testWebspaceAnyLocalization()
 {
     $this->inspector->getWebspace($this->document->reveal())->willReturn(self::FIX_WEBSPACE);
     $this->inspector->getLocales($this->document->reveal())->willReturn(['de']);
     $this->webspace->getLocalization(self::FIX_LOCALE)->willReturn($this->localization1->reveal());
     $this->localization1->getLocalization()->willReturn('en');
     $this->localization2->getLocalization()->willReturn('de');
     $this->hydrateEvent->getOption('load_ghost_content', true)->willReturn(true);
     $this->localization1->getParent()->willReturn(null);
     $this->localization1->getChildren()->willReturn([]);
     $this->webspace->getLocalizations()->willReturn([$this->localization2->reveal()]);
     $this->registry->updateLocale($this->document->reveal(), 'de', 'en')->shouldBeCalled();
     $this->hydrateEvent->setLocale('de')->shouldBeCalled();
     $this->subscriber->handleHydrate($this->hydrateEvent->reveal());
 }