Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 1347-1361 (lines=15) @@
1344
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1345
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testCreateUser
1346
     */
1347
    public function testLoadUserByEmail()
1348
    {
1349
        $repository = $this->getRepository();
1350
1351
        $userService = $repository->getUserService();
1352
1353
        /* BEGIN: Use Case */
1354
        $user = $this->createUserVersion1();
1355
1356
        // Load the newly created user
1357
        $usersReloaded = $userService->loadUsersByEmail('[email protected]');
1358
        /* END: Use Case */
1359
1360
        $this->assertEquals(array($user), $usersReloaded);
1361
    }
1362
1363
    /**
1364
     * Test for the loadUsersByEmail() method.
@@ 1369-1384 (lines=16) @@
1366
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1367
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testLoadUserByEmail
1368
     */
1369
    public function testLoadUserByEmailReturnsEmptyInUnknownEmail()
1370
    {
1371
        $repository = $this->getRepository();
1372
1373
        $userService = $repository->getUserService();
1374
1375
        /* BEGIN: Use Case */
1376
        $this->createUserVersion1();
1377
1378
        // This call will return empty array, because the given
1379
        // login/password combination does not exist.
1380
        $emptyUserList = $userService->loadUsersByEmail('[email protected]');
1381
        /* END: Use Case */
1382
1383
        $this->assertEquals(array(), $emptyUserList);
1384
    }
1385
1386
    /**
1387
     * Test for the deleteUser() method.