eZ\Publish\Core\Repository\Tests\Service\Integration\Base::createUserVersion1 PHP Method

createUserVersion1() protected method

protected createUserVersion1 ( ) : User
return eZ\Publish\Core\Repository\Values\User\User
    protected function createUserVersion1()
    {
        $repository = $this->repository;
        /* BEGIN: Inline */
        // ID of the "Editors" user group in an eZ Publish demo installation
        $editorsGroupId = 13;
        $userService = $repository->getUserService();
        // Instantiate a create struct with mandatory properties
        $userCreate = $userService->newUserCreateStruct('user', '[email protected]', 'secret', 'eng-US');
        $userCreate->enabled = true;
        // Set some fields required by the user ContentType
        $userCreate->setField('first_name', 'Example');
        $userCreate->setField('last_name', 'User');
        // Load parent group for the user
        $group = $userService->loadUserGroup($editorsGroupId);
        // Create a new user instance.
        $user = $userService->createUser($userCreate, array($group));
        /* END: Inline */
        return $user;
    }