Skip to content

Commit

Permalink
Merge pull request #188 from ibexa/temp_1.3_to_4.3
Browse files Browse the repository at this point in the history
Merge branch '1.3' of ezsystems/ezplatform-kernel into 4.3
  • Loading branch information
adamwojs authored Jan 9, 2023
2 parents 5ec6cb5 + 32f395e commit cfb9e6f
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/bundle/Core/Features/Context/ExceptionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function theLoginFormIsShown()
*/
public function anAccessDeniedExceptionIsThrown($exceptionString)
{
$this->assertSession()->elementExists('css', "abbr[title='$exceptionString']");
$this->assertSession()->elementExists('xpath', "//abbr[@title='$exceptionString']");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,17 +534,11 @@ public function reparent(int $oldParentId, int $newParentId): void
'parent',
$query->createPositionalParameter($newParentId, ParameterType::INTEGER)
)->where(
$query->expr()->andX(
$query->expr()->eq(
'is_alias',
$query->createPositionalParameter(0, ParameterType::INTEGER)
),
$query->expr()->eq(
'parent',
$query->createPositionalParameter(
$oldParentId,
ParameterType::INTEGER
)
$query->expr()->eq(
'parent',
$query->createPositionalParameter(
$oldParentId,
ParameterType::INTEGER
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2813,6 +2813,73 @@ public function testLocationMovedReparentSubtreeHistory()
);
}

/**
* @throws \Doctrine\DBAL\DBALException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ForbiddenException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function testLocationMovedReparentWithCustomAlias(): void
{
$handler = $this->getHandler();
$this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');

$handler->createCustomUrlAlias(
6, // Location's id of 'sub2' alias
'move-this/sub1/sub2-alias',
false,
'eng-GB',
false
);

$handler->publishUrlAliasForLocation(
5, // Location's id of 'sub1' alias that we are moving
3, // Location's id of 'move-here' alias that would be a parent
'sub1',
'eng-GB',
false
);

$handler->locationMoved(
5,
4,
3
);

$customUrlAlias = $handler->lookup('move-here/sub1/sub2-alias');

self::assertEquals(
new UrlAlias(
[
'id' => '10-' . md5('sub2-alias'),
'type' => UrlAlias::LOCATION,
'destination' => '6',
'languageCodes' => ['eng-GB'],
'pathData' => [
[
'always-available' => false,
'translations' => ['eng-GB' => 'move-here'],
],
[
'always-available' => false,
'translations' => ['eng-GB' => 'sub1'],
],
[
'always-available' => false,
'translations' => ['eng-GB' => 'sub2-alias'],
],
],
'alwaysAvailable' => false,
'isHistory' => false,
'isCustom' => true,
'forward' => false,
]
),
$customUrlAlias
);
}

/**
* Test for the locationCopied() method.
*/
Expand Down

0 comments on commit cfb9e6f

Please sign in to comment.