Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 1253-1267 (lines=15) @@
1250
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1251
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testCreateUser
1252
     */
1253
    public function testLoadUserByEmail()
1254
    {
1255
        $repository = $this->getRepository();
1256
1257
        $userService = $repository->getUserService();
1258
1259
        /* BEGIN: Use Case */
1260
        $user = $this->createUserVersion1();
1261
1262
        // Load the newly created user
1263
        $usersReloaded = $userService->loadUsersByEmail('[email protected]');
1264
        /* END: Use Case */
1265
1266
        $this->assertEquals(array($user), $usersReloaded);
1267
    }
1268
1269
    /**
1270
     * Test for the loadUsersByEmail() method.
@@ 1275-1290 (lines=16) @@
1272
     * @see \eZ\Publish\API\Repository\UserService::loadUsersByEmail()
1273
     * @depends eZ\Publish\API\Repository\Tests\UserServiceTest::testLoadUserByEmail
1274
     */
1275
    public function testLoadUserByEmailReturnsEmptyInUnknownEmail()
1276
    {
1277
        $repository = $this->getRepository();
1278
1279
        $userService = $repository->getUserService();
1280
1281
        /* BEGIN: Use Case */
1282
        $this->createUserVersion1();
1283
1284
        // This call will return empty array, because the given
1285
        // login/password combination does not exist.
1286
        $emptyUserList = $userService->loadUsersByEmail('[email protected]');
1287
        /* END: Use Case */
1288
1289
        $this->assertEquals(array(), $emptyUserList);
1290
    }
1291
1292
    /**
1293
     * Test for the deleteUser() method.