Code Duplication    Length = 13-20 lines in 2 locations

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

@@ 1447-1459 (lines=13) @@
1444
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1445
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1446
     */
1447
    public function testSortFieldWithNonSearchableField()
1448
    {
1449
        $repository = $this->getRepository();
1450
        $searchService = $repository->getSearchService();
1451
1452
        $searchService->findContent(
1453
            new Query(
1454
                [
1455
                    'sortClauses' => [new SortClause\Field('template_look', 'title')],
1456
                ]
1457
            )
1458
        );
1459
    }
1460
1461
    /**
1462
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1465-1484 (lines=20) @@
1462
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1463
     * @expectedExceptionMessage Argument '$sortClause->targetData' is invalid: No searchable fields found for the given sort clause target 'title' on 'template_look'
1464
     */
1465
    public function testSortMapLocationDistanceWithNonSearchableField()
1466
    {
1467
        $repository = $this->getRepository();
1468
        $searchService = $repository->getSearchService();
1469
1470
        $searchService->findContent(
1471
            new Query(
1472
                [
1473
                    'sortClauses' => [
1474
                        new SortClause\MapLocationDistance(
1475
                            'template_look',
1476
                            'title',
1477
                            1,
1478
                            2
1479
                        ),
1480
                    ],
1481
                ]
1482
            )
1483
        );
1484
    }
1485
1486
    /**
1487
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException