Code Duplication    Length = 13-20 lines in 2 locations

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

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