Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 1409-1423 (lines=15) @@
1406
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1407
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testCreateUser
1408
     */
1409
    public function testLoadUserByEmail()
1410
    {
1411
        $repository = $this->getRepository();
1412
1413
        $userService = $repository->getUserService();
1414
1415
        /* BEGIN: Use Case */
1416
        $user = $this->createUserVersion1();
1417
1418
        // Load the newly created user
1419
        $usersReloaded = $userService->loadUsersByEmail('[email protected]');
1420
        /* END: Use Case */
1421
1422
        $this->assertEquals(array($user), $usersReloaded);
1423
    }
1424
1425
    /**
1426
     * Test for the loadUsersByEmail() method.
@@ 1431-1446 (lines=16) @@
1428
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1429
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testLoadUserByEmail
1430
     */
1431
    public function testLoadUserByEmailReturnsEmptyInUnknownEmail()
1432
    {
1433
        $repository = $this->getRepository();
1434
1435
        $userService = $repository->getUserService();
1436
1437
        /* BEGIN: Use Case */
1438
        $this->createUserVersion1();
1439
1440
        // This call will return empty array, because the given
1441
        // login/password combination does not exist.
1442
        $emptyUserList = $userService->loadUsersByEmail('[email protected]');
1443
        /* END: Use Case */
1444
1445
        $this->assertEquals(array(), $emptyUserList);
1446
    }
1447
1448
    /**
1449
     * Test for the deleteUser() method.