Code Duplication    Length = 15-16 lines in 2 locations

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

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