Class

eZ\Bundle\EzPublishCoreBundle\Features\Context\UserContext

class UserContext implements Context

Sentences for Users.

Constants

DEFAULT_LANGUAGE

USER_IDENTIFIER

These values are set by the default eZ Publish installation.

USERGROUP_ROOT_CONTENT_ID

USERGROUP_ROOT_LOCATION

USERGROUP_ROOT_SUBTREE

USERGROUP_CONTENT_IDENTIFIER

Methods

__construct(Repository $repository, UserService $userService, SearchService $searchService)

User searchUserByLogin($username, $parentGroupId = null)

Search User with given username, optionally at given location.

search searchUserGroups(string $name, string $parentLocationId = null)

Search User Groups with given name.

UserGroup createUserGroup(string $name, UserGroup $parentGroup = null)

Create new User Group inside existing parent User Group.

User ensureUserExists(string $username, string $email, string $password, string $parentGroupName = null)

Make sure a User with name $username, $email and $password exists in parent group.

ensureUserDoesntExist(string $username, string $parentGroupName = null)

Make sure a User with name $username does not exist (in parent group).

bool checkUserExistenceByUsername(string $username, string $parentGroupName = null)

Checks if the User with username $username exists.

bool checkUserExistenceByEmail(string $email, string $parentGroupName = null)

Checks if the User with email $email exists.

createPasswordHash($login, $password, $type)

User iHaveUser($username)

User iHaveUserWithUsernameEmailAndPassword($username, $email, $password)

User iHaveUserInGroup($username, $parentGroupName)

User iHaveUserWithUsernameEmailAndPasswordInGroup($username, $email, $password, $parentGroupName)

iDontHaveUser($username)

iDontHaveUserInGroup($username, $parentGroup)

iHaveTheFollowingUsers(TableNode $table)

assertUserWithNameExists($username)

assertUserWithNameDoesntExist($username)

assertUserWithNameExistsInGroup($username, $parentGroup)

assertUserWithNameDoesntExistInGroup($username, $parentGroup)

assertUserWithNameDoesntExistInGroups($username, TableNode $table)

assertUserWithNameExistsWithFields($username, TableNode $table)

Details

at line 54
public __construct(Repository $repository, UserService $userService, SearchService $searchService)

Parameters

Repository $repository
UserService $userService
SearchService $searchService

at line 69
public User searchUserByLogin($username, $parentGroupId = null)

Search User with given username, optionally at given location.

Parameters

$username
$parentGroupId

Return Value

User found

at line 100
public search searchUserGroups(string $name, string $parentLocationId = null)

Search User Groups with given name.

Parameters

string $name name of User Group to search for
string $parentLocationId (optional) parent location id to search in

Return Value

search results

at line 167
public UserGroup createUserGroup(string $name, UserGroup $parentGroup = null)

Create new User Group inside existing parent User Group.

Parameters

string $name User Group name
UserGroup $parentGroup (optional) parent user group, defaults to UserGroup "/Users"

Return Value

UserGroup

at line 189
public User ensureUserExists(string $username, string $email, string $password, string $parentGroupName = null)

Make sure a User with name $username, $email and $password exists in parent group.

Parameters

string $username User name
string $email User's email
string $password User's password
string $parentGroupName (optional) name of the parent group to check

Return Value

User

at line 234
public ensureUserDoesntExist(string $username, string $parentGroupName = null)

Make sure a User with name $username does not exist (in parent group).

Parameters

string $username User name
string $parentGroupName (optional) name of the parent group to check

at line 274
public bool checkUserExistenceByUsername(string $username, string $parentGroupName = null)

Checks if the User with username $username exists.

Parameters

string $username User name
string $parentGroupName User group name to search inside

Return Value

bool true if it exists, false if user or group don't exist

at line 300
public bool checkUserExistenceByEmail(string $email, string $parentGroupName = null)

Checks if the User with email $email exists.

Parameters

string $email User email
string $parentGroupName User group name to search inside

Return Value

bool true if it exists, false if not

at line 320
public createPasswordHash($login, $password, $type)

Parameters

$login
$password
$type

at line 346
public User iHaveUser($username)

Parameters

$username

Return Value

User

at line 360
public User iHaveUserWithUsernameEmailAndPassword($username, $email, $password)

Parameters

$username
$email
$password

Return Value

User

at line 372
public User iHaveUserInGroup($username, $parentGroupName)

Parameters

$username
$parentGroupName

Return Value

User

at line 386
public User iHaveUserWithUsernameEmailAndPasswordInGroup($username, $email, $password, $parentGroupName)

Parameters

$username
$email
$password
$parentGroupName

Return Value

User

at line 396
public iDontHaveUser($username)

Parameters

$username

at line 406
public iDontHaveUserInGroup($username, $parentGroup)

Parameters

$username
$parentGroup

at line 420
public iHaveTheFollowingUsers(TableNode $table)

Parameters

TableNode $table

at line 436
public assertUserWithNameExists($username)

Parameters

$username

at line 449
public assertUserWithNameDoesntExist($username)

Parameters

$username

at line 463
public assertUserWithNameExistsInGroup($username, $parentGroup)

Parameters

$username
$parentGroup

at line 477
public assertUserWithNameDoesntExistInGroup($username, $parentGroup)

Parameters

$username
$parentGroup

at line 495
public assertUserWithNameDoesntExistInGroups($username, TableNode $table)

Parameters

$username
TableNode $table

at line 519
public assertUserWithNameExistsWithFields($username, TableNode $table)

Parameters

$username
TableNode $table