Code Duplication    Length = 19-20 lines in 2 locations

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

@@ 570-589 (lines=20) @@
567
     *
568
     * @covers \eZ\Publish\API\Repository\UserService::loadUserByCredentials
569
     */
570
    public function testLoadUserByCredentials()
571
    {
572
        $userService = $this->repository->getUserService();
573
574
        $loadedUser = $userService->loadUserByCredentials('admin', 'publish');
575
        self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\User', $loadedUser);
576
577
        $this->assertPropertiesCorrect(
578
            array(
579
                'id' => 14,
580
                'login' => 'admin',
581
                'email' => '[email protected]',
582
                'passwordHash' => 'c78e3b0f3d9244ed8c6d1c29464bdff9',
583
                'hashAlgorithm' => User::PASSWORD_HASH_MD5_USER,
584
                'enabled' => true,
585
                'maxLogin' => 10,
586
            ),
587
            $loadedUser
588
        );
589
    }
590
591
    /**
592
     * Test loading a user by credentials throwing NotFoundException.
@@ 858-876 (lines=19) @@
855
     *
856
     * @covers \eZ\Publish\API\Repository\UserService::newUserCreateStruct
857
     */
858
    public function testNewUserCreateStruct()
859
    {
860
        $userService = $this->repository->getUserService();
861
862
        $userCreateStruct = $userService->newUserCreateStruct('admin', '[email protected]', 'password', 'eng-GB');
863
        self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\UserCreateStruct', $userCreateStruct);
864
865
        $this->assertPropertiesCorrect(
866
            array(
867
                'mainLanguageCode' => 'eng-GB',
868
                'login' => 'admin',
869
                'email' => '[email protected]',
870
                'password' => 'password',
871
                'enabled' => true,
872
                'fields' => array(),
873
            ),
874
            $userCreateStruct
875
        );
876
    }
877
878
    /**
879
     * Test creating new UserGroupCreateStruct.