Skip to content

Commit

Permalink
Merge branch '7.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
glye committed Dec 5, 2018
2 parents 8231815 + 8b99091 commit b6087af
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Repository/Tests/URLAliasServiceTest.php
Expand Up @@ -1215,6 +1215,56 @@ public function testRefreshSystemUrlAliasesForContentsWithUpdatedContentTypes()
$this->assertUrlIsCurrent('/DE-Short-Name/DE-Nested-Short-Name', $nestedFolderLocation->id);
}

/**
* Test that created non-latin aliases are non-empty and unique.
*
* @throws \eZ\Publish\API\Repository\Exceptions\ForbiddenException
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
* @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
*/
public function testCreateNonLatinNonEmptyUniqueAliases()
{
$repository = $this->getRepository();
$urlAliasService = $repository->getURLAliasService();
$locationService = $repository->getLocationService();

$folderNames = [
'eng-GB' => 'ひらがな',
];

$folderLocation1 = $locationService->loadLocation(
$this->createFolder($folderNames, 2)->contentInfo->mainLocationId
);
$urlAlias1 = $urlAliasService->lookup('/1');
self::assertPropertiesCorrect(
[
'destination' => $folderLocation1->id,
'path' => '/1',
'languageCodes' => ['eng-GB'],
'isHistory' => false,
'isCustom' => false,
'forward' => false,
],
$urlAlias1
);

$folderLocation2 = $locationService->loadLocation(
$this->createFolder($folderNames, 2)->contentInfo->mainLocationId
);
$urlAlias2 = $urlAliasService->lookup('/2');
self::assertPropertiesCorrect(
[
'destination' => $folderLocation2->id,
'path' => '/2',
'languageCodes' => ['eng-GB'],
'isHistory' => false,
'isCustom' => false,
'forward' => false,
],
$urlAlias2
);
}

/**
* Test restoring missing current URL which has existing history.
*
Expand Down

0 comments on commit b6087af

Please sign in to comment.