Code Duplication    Length = 25-25 lines in 2 locations

eZ/Publish/API/Repository/Tests/SearchServiceTest.php 2 locations

@@ 907-931 (lines=25) @@
904
        );
905
    }
906
907
    public function testFindNoPerformCount()
908
    {
909
        $repository = $this->getRepository();
910
        $searchService = $repository->getSearchService();
911
912
        $query = new Query();
913
        $query->performCount = false;
914
        $query->query = new Criterion\ContentTypeId(
915
            array(4)
916
        );
917
918
        $searchHit = $searchService->findContent($query);
919
920
        if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
921
            $this->assertEquals(
922
                null,
923
                $searchHit->totalCount
924
            );
925
        } else {
926
            $this->assertEquals(
927
                2,
928
                $searchHit->totalCount
929
            );
930
        }
931
    }
932
933
    /**
934
     * @expectedException \RuntimeException
@@ 955-979 (lines=25) @@
952
        $searchService->findContent($query);
953
    }
954
955
    public function testFindLocationsNoPerformCount()
956
    {
957
        $repository = $this->getRepository();
958
        $searchService = $repository->getSearchService();
959
960
        $query = new LocationQuery();
961
        $query->performCount = false;
962
        $query->query = new Criterion\ContentTypeId(
963
            array(4)
964
        );
965
966
        $searchHit = $searchService->findLocations($query);
967
968
        if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
969
            $this->assertEquals(
970
                null,
971
                $searchHit->totalCount
972
            );
973
        } else {
974
            $this->assertEquals(
975
                2,
976
                $searchHit->totalCount
977
            );
978
        }
979
    }
980
981
    /**
982
     * @expectedException \RuntimeException