Code Duplication    Length = 15-16 lines in 2 locations

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

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