Code Duplication    Length = 9-10 lines in 3 locations

tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php 3 locations

@@ 171-180 (lines=10) @@
168
        return $address;
169
    }
170
171
    public function testBasicFind()
172
    {
173
        $user1Id = $this->loadFixture();
174
        $repos = $this->em->getRepository(CmsUser::class);
175
176
        $user = $repos->find($user1Id);
177
        self::assertInstanceOf(CmsUser::class,$user);
178
        self::assertEquals('Roman', $user->name);
179
        self::assertEquals('freak', $user->status);
180
    }
181
182
    public function testFindByField()
183
    {
@@ 402-410 (lines=9) @@
399
    /**
400
     * @group DDC-817
401
     */
402
    public function testFindOneByAssociationKey()
403
    {
404
        list($userId, $addressId) = $this->loadAssociatedFixture();
405
        $repos = $this->em->getRepository(CmsAddress::class);
406
        $address = $repos->findOneBy(['user' => $userId]);
407
408
        self::assertInstanceOf(CmsAddress::class, $address);
409
        self::assertEquals($addressId, $address->id);
410
    }
411
412
    /**
413
     * @group DDC-1241
@@ 429-438 (lines=10) @@
426
    /**
427
     * @group DDC-817
428
     */
429
    public function testFindByAssociationKey()
430
    {
431
        list($userId, $addressId) = $this->loadAssociatedFixture();
432
        $repos = $this->em->getRepository(CmsAddress::class);
433
        $addresses = $repos->findBy(['user' => $userId]);
434
435
        self::assertContainsOnly(CmsAddress::class, $addresses);
436
        self::assertCount(1, $addresses);
437
        self::assertEquals($addressId, $addresses[0]->id);
438
    }
439
440
    /**
441
     * @group DDC-817