Code Duplication    Length = 13-20 lines in 2 locations

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

@@ 1310-1322 (lines=13) @@
1307
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1308
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1309
     */
1310
    public function testSortFieldWithNonSearchableField()
1311
    {
1312
        $repository = $this->getRepository();
1313
        $searchService = $repository->getSearchService();
1314
1315
        $searchService->findContent(
1316
            new Query(
1317
                [
1318
                    'sortClauses' => [new SortClause\Field('template_look', 'title')],
1319
                ]
1320
            )
1321
        );
1322
    }
1323
1324
    /**
1325
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1328-1347 (lines=20) @@
1325
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1326
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1327
     */
1328
    public function testSortMapLocationDistanceWithNonSearchableField()
1329
    {
1330
        $repository = $this->getRepository();
1331
        $searchService = $repository->getSearchService();
1332
1333
        $searchService->findContent(
1334
            new Query(
1335
                [
1336
                    'sortClauses' => [
1337
                        new SortClause\MapLocationDistance(
1338
                            'template_look',
1339
                            'title',
1340
                            1,
1341
                            2
1342
                        ),
1343
                    ],
1344
                ]
1345
            )
1346
        );
1347
    }
1348
1349
    /**
1350
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException