Code Duplication    Length = 19-20 lines in 2 locations

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

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