Code Duplication    Length = 13-20 lines in 2 locations

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

@@ 1376-1388 (lines=13) @@
1373
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1374
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1375
     */
1376
    public function testSortFieldWithNonSearchableField()
1377
    {
1378
        $repository = $this->getRepository();
1379
        $searchService = $repository->getSearchService();
1380
1381
        $searchService->findContent(
1382
            new Query(
1383
                array(
1384
                    'sortClauses' => array(new SortClause\Field('template_look', 'title')),
1385
                )
1386
            )
1387
        );
1388
    }
1389
1390
    /**
1391
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1394-1413 (lines=20) @@
1391
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1392
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1393
     */
1394
    public function testSortMapLocationDistanceWithNonSearchableField()
1395
    {
1396
        $repository = $this->getRepository();
1397
        $searchService = $repository->getSearchService();
1398
1399
        $searchService->findContent(
1400
            new Query(
1401
                array(
1402
                    'sortClauses' => array(
1403
                        new SortClause\MapLocationDistance(
1404
                            'template_look',
1405
                            'title',
1406
                            1,
1407
                            2
1408
                        ),
1409
                    ),
1410
                )
1411
            )
1412
        );
1413
    }
1414
1415
    /**
1416
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException