Code Duplication    Length = 16-18 lines in 2 locations

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

@@ 748-765 (lines=18) @@
745
        $this->_em->clear();
746
    }
747
748
    public function testSingleTableInheritance_FilterOnlyOnRootTableWhenFetchingSubEntity()
749
    {
750
        $this->loadCompanySingleTableInheritanceFixtureData();
751
        // Persister
752
        $this->assertEquals(2, count($this->_em->getRepository(CompanyFlexUltraContract::class)->findAll()));
753
        // SQLWalker
754
        $this->assertEquals(2, count($this->_em->createQuery("SELECT cfc FROM Doctrine\Tests\Models\Company\CompanyFlexUltraContract cfc")->getResult()));
755
756
        // Enable the filter
757
        $conf = $this->_em->getConfiguration();
758
        $conf->addFilter("completed_contract", "\Doctrine\Tests\ORM\Functional\CompletedContractFilter");
759
        $this->_em->getFilters()
760
            ->enable("completed_contract")
761
            ->setParameter("completed", true, DBALType::BOOLEAN);
762
763
        $this->assertEquals(1, count($this->_em->getRepository(CompanyFlexUltraContract::class)->findAll()));
764
        $this->assertEquals(1, count($this->_em->createQuery("SELECT cfc FROM Doctrine\Tests\Models\Company\CompanyFlexUltraContract cfc")->getResult()));
765
    }
766
767
    public function testSingleTableInheritance_FilterOnlyOnRootTableWhenFetchingRootEntity()
768
    {
@@ 767-782 (lines=16) @@
764
        $this->assertEquals(1, count($this->_em->createQuery("SELECT cfc FROM Doctrine\Tests\Models\Company\CompanyFlexUltraContract cfc")->getResult()));
765
    }
766
767
    public function testSingleTableInheritance_FilterOnlyOnRootTableWhenFetchingRootEntity()
768
    {
769
        $this->loadCompanySingleTableInheritanceFixtureData();
770
        $this->assertEquals(4, count($this->_em->getRepository(CompanyFlexContract::class)->findAll()));
771
        $this->assertEquals(4, count($this->_em->createQuery("SELECT cfc FROM Doctrine\Tests\Models\Company\CompanyFlexContract cfc")->getResult()));
772
773
        // Enable the filter
774
        $conf = $this->_em->getConfiguration();
775
        $conf->addFilter("completed_contract", "\Doctrine\Tests\ORM\Functional\CompletedContractFilter");
776
        $this->_em->getFilters()
777
            ->enable("completed_contract")
778
            ->setParameter("completed", true, DBALType::BOOLEAN);
779
780
        $this->assertEquals(2, count($this->_em->getRepository(CompanyFlexContract::class)->findAll()));
781
        $this->assertEquals(2, count($this->_em->createQuery("SELECT cfc FROM Doctrine\Tests\Models\Company\CompanyFlexContract cfc")->getResult()));
782
    }
783
784
    private function loadCompanySingleTableInheritanceFixtureData()
785
    {