Code Duplication    Length = 19-19 lines in 2 locations

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

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