/**
  * @param \eZ\Publish\API\Repository\URLAliasService $urlAliasService
  * @param array $expectedSubItemAliases
  */
 private function assertAliasesBeforeCopy($urlAliasService, array $expectedSubItemAliases)
 {
     foreach ($expectedSubItemAliases as $aliasUrl) {
         try {
             $urlAliasService->lookup($aliasUrl);
             $this->fail('We didn\'t expect to find alias, but it was found');
         } catch (\Exception $e) {
             $this->assertTrue(true);
             // OK - alias was not found
         }
     }
 }
 /**
  * Returns the UrlAlias object to use, starting from the request.
  *
  * @param $pathinfo
  * @return URLAlias
  */
 protected function getUrlAlias($pathinfo)
 {
     return $this->urlAliasService->lookup($pathinfo);
 }
Exemplo n.º 3
0
 /**
  * looks up the URLAlias for the given url.
  *
  * @param string $url
  * @param string $languageCode
  *
  * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException if the path does not exist or is not valid for the given language
  *
  * @return \eZ\Publish\API\Repository\Values\Content\URLAlias
  */
 public function lookup($url, $languageCode = null)
 {
     return $this->service->lookup($url, $languageCode);
 }
Exemplo n.º 4
0
 /**
  * @param URLAliasService $urlAliasService
  * @param string $urlPath Url alias path
  *
  * @return \eZ\Publish\API\Repository\Values\Content\URLAlias
  */
 private function assertAliasExists(URLAliasService $urlAliasService, $urlPath)
 {
     $urlAlias = $urlAliasService->lookup($urlPath);
     $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\URLAlias', $urlAlias);
     return $urlAlias;
 }