Code Duplication    Length = 15-16 lines in 2 locations

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

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