Skip to content

Commit

Permalink
EZP-30008: More unique uniqid() (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
glye authored Jan 18, 2019
1 parent d9b569c commit cfb9c44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion features/Context/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function createContentType(ContentTypeCreateStruct $struct)
public function newContentTypeCreateStruct($identifier = null)
{
return $this->contentTypeService->newContentTypeCreateStruct(
$identifier ?: $identifier = 'content_type_' . uniqid()
$identifier ?: $identifier = uniqid('content_type_', true)
);
}

Expand Down
9 changes: 5 additions & 4 deletions features/Context/UserRegistrationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function loginAsUserWithUserRegisterPolicy()
private function createUserWithRole(Role $role)
{
$userService = $this->getRepository()->getUserService();
$username = uniqid($role->identifier);
$username = uniqid($role->identifier, true);
$createStruct = $userService->newUserCreateStruct(
$username,
$username . '@example.com',
Expand Down Expand Up @@ -123,7 +123,8 @@ private function createUserWithRole(Role $role)
private function createRegistrationRole($withUserRegisterPolicy = true)
{
$roleIdentifier = uniqid(
'anonymous_role_' . ($withUserRegisterPolicy ? 'with' : 'without') . '_register'
'anonymous_role_' . ($withUserRegisterPolicy ? 'with' : 'without') . '_register',
true
);

$roleService = $this->getRepository()->getRoleService();
Expand Down Expand Up @@ -208,7 +209,7 @@ public function iFillInTheFormWithValidValues()
{
$page = $this->getSession()->getPage();

$this->registrationUsername = uniqid('registration_username_');
$this->registrationUsername = uniqid('registration_username_', true);

$page->fillField('ezrepoforms_user_register[fieldsData][first_name][value]', 'firstname');
$page->fillField('ezrepoforms_user_register[fieldsData][last_name][value]', 'firstname');
Expand Down Expand Up @@ -259,7 +260,7 @@ public function createUserGroup()
$userService = $this->getRepository()->getUserService();

$groupCreateStruct = $userService->newUserGroupCreateStruct(self::$language);
$groupCreateStruct->setField('name', uniqid('User registration group '));
$groupCreateStruct->setField('name', uniqid('User registration group ', true));
$this->customUserGroup = $userService->createUserGroup(
$groupCreateStruct,
$userService->loadUserGroup(self::$groupId)
Expand Down

0 comments on commit cfb9c44

Please sign in to comment.