Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 1372-1386 (lines=15) @@
1369
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1370
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testCreateUser
1371
     */
1372
    public function testLoadUserByEmail()
1373
    {
1374
        $repository = $this->getRepository();
1375
1376
        $userService = $repository->getUserService();
1377
1378
        /* BEGIN: Use Case */
1379
        $user = $this->createUserVersion1();
1380
1381
        // Load the newly created user
1382
        $usersReloaded = $userService->loadUsersByEmail('[email protected]');
1383
        /* END: Use Case */
1384
1385
        $this->assertEquals(array($user), $usersReloaded);
1386
    }
1387
1388
    /**
1389
     * Test for the loadUsersByEmail() method.
@@ 1394-1409 (lines=16) @@
1391
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1392
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testLoadUserByEmail
1393
     */
1394
    public function testLoadUserByEmailReturnsEmptyInUnknownEmail()
1395
    {
1396
        $repository = $this->getRepository();
1397
1398
        $userService = $repository->getUserService();
1399
1400
        /* BEGIN: Use Case */
1401
        $this->createUserVersion1();
1402
1403
        // This call will return empty array, because the given
1404
        // login/password combination does not exist.
1405
        $emptyUserList = $userService->loadUsersByEmail('[email protected]');
1406
        /* END: Use Case */
1407
1408
        $this->assertEquals(array(), $emptyUserList);
1409
    }
1410
1411
    /**
1412
     * Test for the deleteUser() method.