Code Duplication    Length = 17-21 lines in 2 locations

eZ/Publish/API/Repository/Tests/UserServiceTest.php 2 locations

@@ 746-762 (lines=17) @@
743
     * @see \eZ\Publish\API\Repository\UserService::newUserCreateStruct()
744
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testNewUserCreateStruct
745
     */
746
    public function testNewUserCreateStructSetsExpectedProperties($userCreate)
747
    {
748
        $this->assertEquals(
749
            array(
750
                'login' => 'user',
751
                'email' => '[email protected]',
752
                'password' => 'secret',
753
                'mainLanguageCode' => 'eng-US',
754
            ),
755
            array(
756
                'login' => $userCreate->login,
757
                'email' => $userCreate->email,
758
                'password' => $userCreate->password,
759
                'mainLanguageCode' => $userCreate->mainLanguageCode,
760
            )
761
        );
762
    }
763
764
    /**
765
     * Test for the newUserCreateStruct() method.
@@ 829-849 (lines=21) @@
826
     * @see \eZ\Publish\API\Repository\UserService::createUser()
827
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testCreateUser
828
     */
829
    public function testCreateUserSetsExpectedProperties(User $user)
830
    {
831
        $this->assertEquals(
832
            array(
833
                'login' => 'user',
834
                'email' => '[email protected]',
835
                'passwordHash' => $this->createHash(
836
                    'user',
837
                    'secret',
838
                    $user->hashAlgorithm
839
                ),
840
                'mainLanguageCode' => 'eng-US',
841
            ),
842
            array(
843
                'login' => $user->login,
844
                'email' => $user->email,
845
                'passwordHash' => $user->passwordHash,
846
                'mainLanguageCode' => $user->contentInfo->mainLanguageCode,
847
            )
848
        );
849
    }
850
851
    /**
852
     * Test for the createUser() method.