Code Duplication    Length = 13-20 lines in 2 locations

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

@@ 1181-1193 (lines=13) @@
1178
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1179
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1180
     */
1181
    public function testSortFieldWithNonSearchableField()
1182
    {
1183
        $repository = $this->getRepository();
1184
        $searchService = $repository->getSearchService();
1185
1186
        $searchService->findContent(
1187
            new Query(
1188
                array(
1189
                    'sortClauses' => array(new SortClause\Field('template_look', 'title')),
1190
                )
1191
            )
1192
        );
1193
    }
1194
1195
    /**
1196
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1199-1218 (lines=20) @@
1196
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1197
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1198
     */
1199
    public function testSortMapLocationDistanceWithNonSearchableField()
1200
    {
1201
        $repository = $this->getRepository();
1202
        $searchService = $repository->getSearchService();
1203
1204
        $searchService->findContent(
1205
            new Query(
1206
                array(
1207
                    'sortClauses' => array(
1208
                        new SortClause\MapLocationDistance(
1209
                            'template_look',
1210
                            'title',
1211
                            1,
1212
                            2
1213
                        ),
1214
                    ),
1215
                )
1216
            )
1217
        );
1218
    }
1219
1220
    /**
1221
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException