Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 1297-1311 (lines=15) @@
1294
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1295
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testCreateUser
1296
     */
1297
    public function testLoadUserByEmail()
1298
    {
1299
        $repository = $this->getRepository();
1300
1301
        $userService = $repository->getUserService();
1302
1303
        /* BEGIN: Use Case */
1304
        $user = $this->createUserVersion1();
1305
1306
        // Load the newly created user
1307
        $usersReloaded = $userService->loadUsersByEmail('[email protected]');
1308
        /* END: Use Case */
1309
1310
        $this->assertEquals(array($user), $usersReloaded);
1311
    }
1312
1313
    /**
1314
     * Test for the loadUsersByEmail() method.
@@ 1319-1334 (lines=16) @@
1316
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1317
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testLoadUserByEmail
1318
     */
1319
    public function testLoadUserByEmailReturnsEmptyInUnknownEmail()
1320
    {
1321
        $repository = $this->getRepository();
1322
1323
        $userService = $repository->getUserService();
1324
1325
        /* BEGIN: Use Case */
1326
        $this->createUserVersion1();
1327
1328
        // This call will return empty array, because the given
1329
        // login/password combination does not exist.
1330
        $emptyUserList = $userService->loadUsersByEmail('[email protected]');
1331
        /* END: Use Case */
1332
1333
        $this->assertEquals(array(), $emptyUserList);
1334
    }
1335
1336
    /**
1337
     * Test for the deleteUser() method.