Code Duplication    Length = 24-24 lines in 2 locations

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

@@ 1035-1058 (lines=24) @@
1032
        );
1033
    }
1034
1035
    public function testFindNoPerformCount()
1036
    {
1037
        $repository = $this->getRepository();
1038
        $searchService = $repository->getSearchService();
1039
1040
        $query = new Query();
1041
        $query->performCount = false;
1042
        $query->query = new Criterion\ContentTypeId(
1043
            [4]
1044
        );
1045
1046
        $searchHit = $searchService->findContent($query);
1047
1048
        if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
1049
            $this->assertNull(
1050
                $searchHit->totalCount
1051
            );
1052
        } else {
1053
            $this->assertEquals(
1054
                2,
1055
                $searchHit->totalCount
1056
            );
1057
        }
1058
    }
1059
1060
    /**
1061
     * @expectedException \RuntimeException
@@ 1082-1105 (lines=24) @@
1079
        $searchService->findContent($query);
1080
    }
1081
1082
    public function testFindLocationsNoPerformCount()
1083
    {
1084
        $repository = $this->getRepository();
1085
        $searchService = $repository->getSearchService();
1086
1087
        $query = new LocationQuery();
1088
        $query->performCount = false;
1089
        $query->query = new Criterion\ContentTypeId(
1090
            [4]
1091
        );
1092
1093
        $searchHit = $searchService->findLocations($query);
1094
1095
        if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
1096
            $this->assertNull(
1097
                $searchHit->totalCount
1098
            );
1099
        } else {
1100
            $this->assertEquals(
1101
                2,
1102
                $searchHit->totalCount
1103
            );
1104
        }
1105
    }
1106
1107
    /**
1108
     * @expectedException \RuntimeException