Code Duplication    Length = 13-20 lines in 2 locations

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

@@ 1481-1493 (lines=13) @@
1478
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1479
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1480
     */
1481
    public function testSortFieldWithNonSearchableField()
1482
    {
1483
        $repository = $this->getRepository();
1484
        $searchService = $repository->getSearchService();
1485
1486
        $searchService->findContent(
1487
            new Query(
1488
                [
1489
                    'sortClauses' => [new SortClause\Field('template_look', 'title')],
1490
                ]
1491
            )
1492
        );
1493
    }
1494
1495
    /**
1496
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1499-1518 (lines=20) @@
1496
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1497
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1498
     */
1499
    public function testSortMapLocationDistanceWithNonSearchableField()
1500
    {
1501
        $repository = $this->getRepository();
1502
        $searchService = $repository->getSearchService();
1503
1504
        $searchService->findContent(
1505
            new Query(
1506
                [
1507
                    'sortClauses' => [
1508
                        new SortClause\MapLocationDistance(
1509
                            'template_look',
1510
                            'title',
1511
                            1,
1512
                            2
1513
                        ),
1514
                    ],
1515
                ]
1516
            )
1517
        );
1518
    }
1519
1520
    /**
1521
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException