Code Duplication    Length = 25-25 lines in 2 locations

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

@@ 1102-1126 (lines=25) @@
1099
        );
1100
    }
1101
1102
    public function testFindNoPerformCount()
1103
    {
1104
        $repository = $this->getRepository();
1105
        $searchService = $repository->getSearchService();
1106
1107
        $query = new Query();
1108
        $query->performCount = false;
1109
        $query->query = new Criterion\ContentTypeId(
1110
            array(4)
1111
        );
1112
1113
        $searchHit = $searchService->findContent($query);
1114
1115
        if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
1116
            $this->assertEquals(
1117
                null,
1118
                $searchHit->totalCount
1119
            );
1120
        } else {
1121
            $this->assertEquals(
1122
                2,
1123
                $searchHit->totalCount
1124
            );
1125
        }
1126
    }
1127
1128
    /**
1129
     * @expectedException \RuntimeException
@@ 1150-1174 (lines=25) @@
1147
        $searchService->findContent($query);
1148
    }
1149
1150
    public function testFindLocationsNoPerformCount()
1151
    {
1152
        $repository = $this->getRepository();
1153
        $searchService = $repository->getSearchService();
1154
1155
        $query = new LocationQuery();
1156
        $query->performCount = false;
1157
        $query->query = new Criterion\ContentTypeId(
1158
            array(4)
1159
        );
1160
1161
        $searchHit = $searchService->findLocations($query);
1162
1163
        if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
1164
            $this->assertEquals(
1165
                null,
1166
                $searchHit->totalCount
1167
            );
1168
        } else {
1169
            $this->assertEquals(
1170
                2,
1171
                $searchHit->totalCount
1172
            );
1173
        }
1174
    }
1175
1176
    /**
1177
     * @expectedException \RuntimeException