Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 856-874 (lines=19) @@
853
    /**
854
     * @group DDC-2430
855
     */
856
    public function testMatchingCriteriaAssocationByObjectInMemory()
857
    {
858
        list($userId, $addressId) = $this->loadAssociatedFixture();
859
860
        $user = $this->em->find(CmsUser::class, $userId);
861
862
        $criteria = new Criteria(
863
            Criteria::expr()->eq('user', $user)
864
        );
865
866
        $repository = $this->em->getRepository(CmsAddress::class);
867
        $addresses = $repository->matching($criteria);
868
869
        self::assertEquals(1, count($addresses));
870
871
        $addresses = new ArrayCollection($repository->findAll());
872
873
        self::assertEquals(1, count($addresses->matching($criteria)));
874
    }
875
876
    /**
877
     * @group DDC-2430
@@ 879-897 (lines=19) @@
876
    /**
877
     * @group DDC-2430
878
     */
879
    public function testMatchingCriteriaAssocationInWithArray()
880
    {
881
        list($userId, $addressId) = $this->loadAssociatedFixture();
882
883
        $user = $this->em->find(CmsUser::class, $userId);
884
885
        $criteria = new Criteria(
886
            Criteria::expr()->in('user', [$user])
887
        );
888
889
        $repository = $this->em->getRepository(CmsAddress::class);
890
        $addresses = $repository->matching($criteria);
891
892
        self::assertEquals(1, count($addresses));
893
894
        $addresses = new ArrayCollection($repository->findAll());
895
896
        self::assertEquals(1, count($addresses->matching($criteria)));
897
    }
898
899
    public function testMatchingCriteriaContainsComparison()
900
    {