Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 1439-1453 (lines=15) @@
1436
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1437
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testCreateUser
1438
     */
1439
    public function testLoadUserByEmail()
1440
    {
1441
        $repository = $this->getRepository();
1442
1443
        $userService = $repository->getUserService();
1444
1445
        /* BEGIN: Use Case */
1446
        $user = $this->createUserVersion1();
1447
1448
        // Load the newly created user
1449
        $usersReloaded = $userService->loadUsersByEmail('[email protected]');
1450
        /* END: Use Case */
1451
1452
        $this->assertEquals(array($user), $usersReloaded);
1453
    }
1454
1455
    /**
1456
     * Test for the loadUsersByEmail() method.
@@ 1461-1476 (lines=16) @@
1458
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1459
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testLoadUserByEmail
1460
     */
1461
    public function testLoadUserByEmailReturnsEmptyInUnknownEmail()
1462
    {
1463
        $repository = $this->getRepository();
1464
1465
        $userService = $repository->getUserService();
1466
1467
        /* BEGIN: Use Case */
1468
        $this->createUserVersion1();
1469
1470
        // This call will return empty array, because the given
1471
        // login/password combination does not exist.
1472
        $emptyUserList = $userService->loadUsersByEmail('[email protected]');
1473
        /* END: Use Case */
1474
1475
        $this->assertEquals(array(), $emptyUserList);
1476
    }
1477
1478
    /**
1479
     * Test for the deleteUser() method.