Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 819-837 (lines=19) @@
816
    /**
817
     * @group DDC-2430
818
     */
819
    public function testMatchingCriteriaAssocationByObjectInMemory()
820
    {
821
        list($userId, $addressId) = $this->loadAssociatedFixture();
822
823
        $user = $this->em->find(CmsUser::class, $userId);
824
825
        $criteria = new Criteria(
826
            Criteria::expr()->eq('user', $user)
827
        );
828
829
        $repository = $this->em->getRepository(CmsAddress::class);
830
        $addresses = $repository->matching($criteria);
831
832
        self::assertCount(1, $addresses);
833
834
        $addresses = new ArrayCollection($repository->findAll());
835
836
        self::assertCount(1, $addresses->matching($criteria));
837
    }
838
839
    /**
840
     * @group DDC-2430
@@ 842-860 (lines=19) @@
839
    /**
840
     * @group DDC-2430
841
     */
842
    public function testMatchingCriteriaAssocationInWithArray()
843
    {
844
        list($userId, $addressId) = $this->loadAssociatedFixture();
845
846
        $user = $this->em->find(CmsUser::class, $userId);
847
848
        $criteria = new Criteria(
849
            Criteria::expr()->in('user', [$user])
850
        );
851
852
        $repository = $this->em->getRepository(CmsAddress::class);
853
        $addresses = $repository->matching($criteria);
854
855
        self::assertCount(1, $addresses);
856
857
        $addresses = new ArrayCollection($repository->findAll());
858
859
        self::assertCount(1, $addresses->matching($criteria));
860
    }
861
862
    public function testMatchingCriteriaContainsComparison()
863
    {