Code Duplication    Length = 13-20 lines in 2 locations

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

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