Code Duplication    Length = 25-25 lines in 2 locations

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

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