Code Duplication    Length = 13-20 lines in 2 locations

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

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