Code Duplication    Length = 17-21 lines in 2 locations

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

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