Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/mysql/cleandata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VALUES (2, 2, 1, 'not_locked', 3, 0),
(2, 2, 2, 'locked', 3, 1);

INSERT INTO `ibexa_object_state_group` (`default_language_id`, `id`, `identifier`, `language_mask`)
VALUES (2,2,'ez_lock',3);
VALUES (2,2,'ibexa_lock',3);

INSERT INTO `ibexa_object_state_group_language` (`contentobject_state_group_id`, `description`, `language_id`, `name`, `real_language_id`)
VALUES (2,'',3,'Lock',2);
Expand Down
2 changes: 1 addition & 1 deletion data/postgresql/cleandata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VALUES (2, 2, 1, 'not_locked', 3, 0),
(2, 2, 2, 'locked', 3, 1);

INSERT INTO "ibexa_object_state_group" ("default_language_id", "id", "identifier", "language_mask")
VALUES (2, 2, 'ez_lock', 3);
VALUES (2, 2, 'ibexa_lock', 3);

INSERT INTO "ibexa_object_state_group_language" ("contentobject_state_group_id", "description","language_id", "name", "real_language_id")
VALUES (2, '', 3, 'Lock', 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ public function getCriteriaForInitialData(): iterable
yield 'ObjectStateIdentifier=not_locked' => new Criterion\ObjectStateIdentifier(
'not_locked'
);
yield 'ObjectStateIdentifier=ez_lock(not_locked)' => new Criterion\ObjectStateIdentifier(
yield 'ObjectStateIdentifier=ibexa_lock(not_locked)' => new Criterion\ObjectStateIdentifier(
['not_locked'],
'ez_lock'
'ibexa_lock'
);
yield 'ParentLocationId=1' => new Criterion\ParentLocationId(1);
yield 'RemoteId=8a9c9c761004866fb458d89910f52bee' => new Criterion\RemoteId(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function testUpdateObjectStateGroupThrowsUnauthorizedException()
$permissionResolver->setCurrentUserReference($userService->loadUser($anonymousUserId));

// $objectStateGroupId contains the ID of the standard object state
// group ez_lock.
// group ibexa_lock.
$objectStateService = $repository->getObjectStateService();

$loadedObjectStateGroup = $objectStateService->loadObjectStateGroup(
Expand Down Expand Up @@ -138,7 +138,7 @@ public function testDeleteObjectStateGroupThrowsUnauthorizedException()
$permissionResolver->setCurrentUserReference($userService->loadUser($anonymousUserId));

// $objectStateGroupId contains the ID of the standard object state
// group ez_lock.
// group ibexa_lock.
$objectStateService = $repository->getObjectStateService();

$loadedObjectStateGroup = $objectStateService->loadObjectStateGroup(
Expand Down Expand Up @@ -175,7 +175,7 @@ public function testCreateObjectStateThrowsUnauthorizedException()
$permissionResolver->setCurrentUserReference($userService->loadUser($anonymousUserId));

// $objectStateGroupId contains the ID of the standard object state
// group ez_lock.
// group ibexa_lock.
$objectStateService = $repository->getObjectStateService();

$loadedObjectStateGroup = $objectStateService->loadObjectStateGroup(
Expand Down Expand Up @@ -353,7 +353,7 @@ public function testSetContentStateThrowsUnauthorizedException()
$permissionResolver->setCurrentUserReference($userService->loadUser($anonymousUserId));

// $anonymousUserId is the content ID of "Anonymous User"
// $ezLockObjectStateGroupId contains the ID of the "ez_lock" object
// $ezLockObjectStateGroupId contains the ID of the "ibexa_lock" object
// state group
// $lockedObjectStateId is the ID of the state "locked"
$contentService = $repository->getContentService();
Expand Down
38 changes: 19 additions & 19 deletions tests/integration/Core/Repository/ObjectStateServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
class ObjectStateServiceTest extends BaseTestCase
{
private const EXISTING_OBJECT_STATE_GROUP_IDENTIFIER = 'ez_lock';
private const EXISTING_OBJECT_STATE_GROUP_IDENTIFIER = 'ibexa_lock';
private const EXISTING_OBJECT_STATE_IDENTIFIER = 'locked';

private const NON_EXISTING_OBJECT_STATE_GROUP_IDENTIFIER = 'non-existing';
Expand Down Expand Up @@ -299,8 +299,8 @@ public function testCreateObjectStateGroupThrowsInvalidArgumentException()
$objectStateService = $repository->getObjectStateService();

$objectStateGroupCreate = $objectStateService->newObjectStateGroupCreateStruct(
// 'ez_lock' is already existing identifier
'ez_lock'
// 'ibexa_lock' is already existing identifier
'ibexa_lock'
);
$objectStateGroupCreate->defaultLanguageCode = 'eng-US';
$objectStateGroupCreate->names = [
Expand All @@ -312,7 +312,7 @@ public function testCreateObjectStateGroupThrowsInvalidArgumentException()
'eng-GB' => 'Put something ton Sindelfingen.',
];

// This call will fail because group with 'ez_lock' identifier already exists
// This call will fail because group with 'ibexa_lock' identifier already exists
$objectStateService->createObjectStateGroup(
$objectStateGroupCreate
);
Expand All @@ -330,7 +330,7 @@ public function testLoadObjectStateGroup()
$objectStateGroupId = $this->generateId('objectstategroup', 2);
/* BEGIN: Use Case */
// $objectStateGroupId contains the ID of the standard object state
// group ez_lock.
// group ibexa_lock.
$objectStateService = $repository->getObjectStateService();

$loadedObjectStateGroup = $objectStateService->loadObjectStateGroup(
Expand All @@ -346,7 +346,7 @@ public function testLoadObjectStateGroup()
$this->assertPropertiesCorrect(
[
'id' => 2,
'identifier' => 'ez_lock',
'identifier' => 'ibexa_lock',
'mainLanguageCode' => 'eng-US',
'languageCodes' => ['eng-US'],
'names' => ['eng-US' => 'Lock'],
Expand Down Expand Up @@ -404,7 +404,7 @@ public function testLoadObjectStateGroupByIdentifier(): void
$this->assertPropertiesCorrect(
[
'id' => 2,
'identifier' => 'ez_lock',
'identifier' => 'ibexa_lock',
'mainLanguageCode' => 'eng-US',
'languageCodes' => ['eng-US'],
'names' => ['eng-US' => 'Lock'],
Expand Down Expand Up @@ -447,7 +447,7 @@ public function testLoadObjectStateGroups()
$repository = $this->getRepository();

$expectedGroupIdentifiers = $this->getGroupIdentifierMap($this->createObjectStateGroups());
$expectedGroupIdentifiers['ez_lock'] = true;
$expectedGroupIdentifiers['ibexa_lock'] = true;

/* BEGIN: Use Case */
$objectStateService = $repository->getObjectStateService();
Expand Down Expand Up @@ -636,7 +636,7 @@ public function testLoadObjectStates()
$objectStateGroupId = $this->generateId('objectstategroup', 2);
/* BEGIN: Use Case */
// $objectStateGroupId contains the ID of the standard object state
// group ez_lock.
// group ibexa_lock.
$objectStateService = $repository->getObjectStateService();

$objectStateGroup = $objectStateService->loadObjectStateGroup(
Expand Down Expand Up @@ -671,7 +671,7 @@ public function testUpdateObjectStateGroup()
$objectStateGroupId = $this->generateId('objectstategroup', 2);
/* BEGIN: Use Case */
// $objectStateGroupId contains the ID of the standard object state
// group ez_lock.
// group ibexa_lock.
$objectStateService = $repository->getObjectStateService();

$loadedObjectStateGroup = $objectStateService->loadObjectStateGroup(
Expand Down Expand Up @@ -742,7 +742,7 @@ public function testUpdateObjectStateGroupChosenFieldsOnly()
$this->assertPropertiesCorrect(
[
'id' => 2,
'identifier' => 'ez_lock',
'identifier' => 'ibexa_lock',
'mainLanguageCode' => 'eng-GB',
'languageCodes' => ['eng-GB'],
'names' => ['eng-GB' => 'Test'],
Expand Down Expand Up @@ -790,8 +790,8 @@ public function testUpdateObjectStateGroupThrowsInvalidArgumentException()
);

$groupUpdateStruct = $objectStateService->newObjectStateGroupUpdateStruct();
// 'ez_lock' is the identifier of already existing group
$groupUpdateStruct->identifier = 'ez_lock';
// 'ibexa_lock' is the identifier of already existing group
$groupUpdateStruct->identifier = 'ibexa_lock';
$groupUpdateStruct->defaultLanguageCode = 'ger-DE';
$groupUpdateStruct->names = [
'ger-DE' => 'Sindelfingen',
Expand All @@ -800,7 +800,7 @@ public function testUpdateObjectStateGroupThrowsInvalidArgumentException()
'ger-DE' => 'Sindelfingen ist nicht nur eine Stadt',
];

// This call will fail since state group with 'ez_lock' identifier already exists
// This call will fail since state group with 'ibexa_lock' identifier already exists
$objectStateService->updateObjectStateGroup(
$createdObjectStateGroup,
$groupUpdateStruct
Expand Down Expand Up @@ -848,7 +848,7 @@ public function testCreateObjectState()
$objectStateGroupId = $this->generateId('objectstategroup', 2);
/* BEGIN: Use Case */
// $objectStateGroupId contains the ID of the standard object state
// group ez_lock.
// group ibexa_lock.
$objectStateService = $repository->getObjectStateService();

$loadedObjectStateGroup = $objectStateService->loadObjectStateGroup(
Expand Down Expand Up @@ -962,7 +962,7 @@ public function testCreateObjectStateThrowsInvalidArgumentException()

$objectStateGroupId = $this->generateId('objectstategroup', 2);
// $objectStateGroupId contains the ID of the standard object state
// group ez_lock.
// group ibexa_lock.
$objectStateService = $repository->getObjectStateService();

$loadedObjectStateGroup = $objectStateService->loadObjectStateGroup(
Expand Down Expand Up @@ -1605,7 +1605,7 @@ public function testGetContentState()
$ezLockObjectStateGroupId
);

// Loads the state of $contentInfo in the "ez_lock" object state group
// Loads the state of $contentInfo in the "ibexa_lock" object state group
$ezLockObjectState = $objectStateService->getContentState(
$contentInfo,
$ezLockObjectStateGroup
Expand Down Expand Up @@ -1703,7 +1703,7 @@ public function testSetContentState()
$lockedObjectStateId = $this->generateId('objectstate', 2);
/* BEGIN: Use Case */
// $anonymousUserId is the content ID of "Anonymous User"
// $ezLockObjectStateGroupId contains the ID of the "ez_lock" object
// $ezLockObjectStateGroupId contains the ID of the "ibexa_lock" object
// state group
// $lockedObjectStateId is the ID of the state "locked"
$contentService = $repository->getContentService();
Expand Down Expand Up @@ -1850,7 +1850,7 @@ public function testDeleteObjectStateGroup()
$objectStateGroupId = $this->generateId('objectstategroup', 2);
/* BEGIN: Use Case */
// $objectStateGroupId contains the ID of the standard object state
// group ez_lock.
// group ibexa_lock.
$objectStateService = $repository->getObjectStateService();

$loadedObjectStateGroup = $objectStateService->loadObjectStateGroup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class ObjectStateTermAggregationTest extends AbstractAggregationTestCase
{
public function dataProviderForTestFindContentWithAggregation(): iterable
{
$aggregation = new ObjectStateTermAggregation('object_state', 'ez_lock');
$aggregation = new ObjectStateTermAggregation('object_state', 'ibexa_lock');

$builder = new TermAggregationDataSetBuilder($aggregation);
$builder->setExpectedEntries([
Expand All @@ -30,7 +30,7 @@ function (string $identifier): ObjectState {

static $objectStateGroup = null;
if ($objectStateGroup === null) {
$objectStateGroup = $objectStateService->loadObjectStateGroupByIdentifier('ez_lock');
$objectStateGroup = $objectStateService->loadObjectStateGroupByIdentifier('ibexa_lock');
}

return $objectStateService->loadObjectStateByIdentifier($objectStateGroup, $identifier);
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Core/Repository/SearchServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ public function getContentQuerySearches()
],
[
[
'query' => new Criterion\ObjectStateIdentifier(['not_locked'], 'ez_lock'),
'query' => new Criterion\ObjectStateIdentifier(['not_locked'], 'ibexa_lock'),
'sortClauses' => [new SortClause\ContentId()],
'limit' => 50,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ibexa_object_state:
- { default_language_id: 2, group_id: 2, id: 1, identifier: not_locked, language_mask: 3, priority: 0 }
- { default_language_id: 2, group_id: 2, id: 2, identifier: locked, language_mask: 3, priority: 1 }
ibexa_object_state_group:
- { default_language_id: 2, id: 2, identifier: ez_lock, language_mask: 3 }
- { default_language_id: 2, id: 2, identifier: ibexa_lock, language_mask: 3 }
ibexa_object_state_group_language:
- { contentobject_state_group_id: 2, description: '', language_id: 3, name: Lock, real_language_id: 2 }
ibexa_object_state_language:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function testLoadObjectStateGroupData()
[
'ibexa_object_state_group_default_language_id' => 2,
'ibexa_object_state_group_id' => 2,
'ibexa_object_state_group_identifier' => 'ez_lock',
'ibexa_object_state_group_identifier' => 'ibexa_lock',
'ibexa_object_state_group_language_mask' => 3,
'ibexa_object_state_group_language_description' => '',
'ibexa_object_state_group_language_language_id' => 3,
Expand All @@ -162,14 +162,14 @@ public function testLoadObjectStateGroupDataByIdentifier()
{
$gateway = $this->getDatabaseGateway();

$result = $gateway->loadObjectStateGroupDataByIdentifier('ez_lock');
$result = $gateway->loadObjectStateGroupDataByIdentifier('ibexa_lock');

self::assertEquals(
[
[
'ibexa_object_state_group_default_language_id' => 2,
'ibexa_object_state_group_id' => 2,
'ibexa_object_state_group_identifier' => 'ez_lock',
'ibexa_object_state_group_identifier' => 'ibexa_lock',
'ibexa_object_state_group_language_mask' => 3,
'ibexa_object_state_group_language_description' => '',
'ibexa_object_state_group_language_language_id' => 3,
Expand All @@ -193,7 +193,7 @@ public function testLoadObjectStateGroupListData()
[
'ibexa_object_state_group_default_language_id' => 2,
'ibexa_object_state_group_id' => 2,
'ibexa_object_state_group_identifier' => 'ez_lock',
'ibexa_object_state_group_identifier' => 'ibexa_lock',
'ibexa_object_state_group_language_mask' => 3,
'ibexa_object_state_group_language_description' => '',
'ibexa_object_state_group_language_language_id' => 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected function getObjectStateGroupRowsFixture()
[
'ibexa_object_state_group_default_language_id' => 2,
'ibexa_object_state_group_id' => 1,
'ibexa_object_state_group_identifier' => 'ez_lock',
'ibexa_object_state_group_identifier' => 'ibexa_lock',
'ibexa_object_state_group_language_mask' => 3,
'ibexa_object_state_group_language_description' => '',
'ibexa_object_state_group_language_language_id' => 3,
Expand Down Expand Up @@ -188,7 +188,7 @@ protected function getObjectStateFixture()
protected function getObjectStateGroupFixture()
{
$group = new Group();
$group->identifier = 'ez_lock';
$group->identifier = 'ibexa_lock';
$group->defaultLanguage = 'eng-US';
$group->languageCodes = ['eng-US'];
$group->name = ['eng-US' => 'Lock'];
Expand Down Expand Up @@ -224,7 +224,7 @@ protected function getObjectStateGroupInputStructFixture()
$inputStruct = new InputStruct();

$inputStruct->defaultLanguage = 'eng-US';
$inputStruct->identifier = 'ez_lock';
$inputStruct->identifier = 'ibexa_lock';
$inputStruct->name = ['eng-US' => 'Lock'];
$inputStruct->description = ['eng-US' => ''];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ public function testLoadGroupByIdentifier()

$gatewayMock->expects(self::once())
->method('loadObjectStateGroupDataByIdentifier')
->with(self::equalTo('ez_lock'))
->with(self::equalTo('ibexa_lock'))
->will(self::returnValue([[]]));

$mapperMock->expects(self::once())
->method('createObjectStateGroupFromData')
->with(self::equalTo([[]]))
->will(self::returnValue($this->getObjectStateGroupFixture()));

$result = $handler->loadGroupByIdentifier('ez_lock');
$result = $handler->loadGroupByIdentifier('ibexa_lock');

self::assertInstanceOf(
Group::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[
'default_language_id' => 2,
'id' => 2,
'identifier' => 'ez_lock',
'identifier' => 'ibexa_lock',
'language_mask' => 3,
],
],
Expand Down
Loading
Loading