Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 1289-1303 (lines=15) @@
1286
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1287
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testCreateUser
1288
     */
1289
    public function testLoadUserByEmail()
1290
    {
1291
        $repository = $this->getRepository();
1292
1293
        $userService = $repository->getUserService();
1294
1295
        /* BEGIN: Use Case */
1296
        $user = $this->createUserVersion1();
1297
1298
        // Load the newly created user
1299
        $usersReloaded = $userService->loadUsersByEmail('[email protected]');
1300
        /* END: Use Case */
1301
1302
        $this->assertEquals(array($user), $usersReloaded);
1303
    }
1304
1305
    /**
1306
     * Test for the loadUsersByEmail() method.
@@ 1311-1326 (lines=16) @@
1308
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1309
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testLoadUserByEmail
1310
     */
1311
    public function testLoadUserByEmailReturnsEmptyInUnknownEmail()
1312
    {
1313
        $repository = $this->getRepository();
1314
1315
        $userService = $repository->getUserService();
1316
1317
        /* BEGIN: Use Case */
1318
        $this->createUserVersion1();
1319
1320
        // This call will return empty array, because the given
1321
        // login/password combination does not exist.
1322
        $emptyUserList = $userService->loadUsersByEmail('[email protected]');
1323
        /* END: Use Case */
1324
1325
        $this->assertEquals(array(), $emptyUserList);
1326
    }
1327
1328
    /**
1329
     * Test for the deleteUser() method.