Code Duplication    Length = 13-20 lines in 2 locations

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

@@ 1291-1303 (lines=13) @@
1288
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1289
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1290
     */
1291
    public function testSortFieldWithNonSearchableField()
1292
    {
1293
        $repository = $this->getRepository();
1294
        $searchService = $repository->getSearchService();
1295
1296
        $searchService->findContent(
1297
            new Query(
1298
                array(
1299
                    'sortClauses' => array(new SortClause\Field('template_look', 'title')),
1300
                )
1301
            )
1302
        );
1303
    }
1304
1305
    /**
1306
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1309-1328 (lines=20) @@
1306
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1307
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1308
     */
1309
    public function testSortMapLocationDistanceWithNonSearchableField()
1310
    {
1311
        $repository = $this->getRepository();
1312
        $searchService = $repository->getSearchService();
1313
1314
        $searchService->findContent(
1315
            new Query(
1316
                array(
1317
                    'sortClauses' => array(
1318
                        new SortClause\MapLocationDistance(
1319
                            'template_look',
1320
                            'title',
1321
                            1,
1322
                            2
1323
                        ),
1324
                    ),
1325
                )
1326
            )
1327
        );
1328
    }
1329
1330
    /**
1331
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException