Code Duplication    Length = 11-11 lines in 2 locations

eZ/Publish/Core/Repository/Tests/Service/Integration/UserBase.php 2 locations

@@ 492-502 (lines=11) @@
489
     * @expectedException \eZ\Publish\API\Repository\Exceptions\ContentFieldValidationException
490
     * @covers \eZ\Publish\API\Repository\UserService::createUser
491
     */
492
    public function testCreateUserRequiredFieldsEmpty()
493
    {
494
        $userService = $this->repository->getUserService();
495
496
        $userCreateStruct = $userService->newUserCreateStruct('new_user', '[email protected]', 'password', 'eng-GB');
497
        $userCreateStruct->setField('first_name', '', 'eng-GB');
498
        $userCreateStruct->setField('last_name', '', 'eng-GB');
499
500
        $parentGroup = $userService->loadUserGroup(12);
501
        $userService->createUser($userCreateStruct, array($parentGroup));
502
    }
503
504
    /**
505
     * Test creating a user throwing InvalidArgumentException.
@@ 510-520 (lines=11) @@
507
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
508
     * @covers \eZ\Publish\API\Repository\UserService::createUser
509
     */
510
    public function testCreateUserThrowsInvalidArgumentException()
511
    {
512
        $userService = $this->repository->getUserService();
513
514
        $userCreateStruct = $userService->newUserCreateStruct('admin', '[email protected]', 'password', 'eng-GB');
515
        $userCreateStruct->setField('first_name', '', 'eng-GB');
516
        $userCreateStruct->setField('last_name', '', 'eng-GB');
517
518
        $parentGroup = $userService->loadUserGroup(12);
519
        $userService->createUser($userCreateStruct, array($parentGroup));
520
    }
521
522
    /**
523
     * Test loading a user.