Code Duplication    Length = 13-20 lines in 2 locations

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

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