Code Duplication    Length = 18-18 lines in 2 locations

eZ/Publish/API/Repository/Tests/SearchServiceTest.php 1 location

@@ 1378-1395 (lines=18) @@
1375
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1376
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field'
1377
     */
1378
    public function testInvalidFieldIdentifierRange()
1379
    {
1380
        $repository = $this->getRepository();
1381
        $searchService = $repository->getSearchService();
1382
1383
        $searchService->findContent(
1384
            new Query(
1385
                [
1386
                    'filter' => new Criterion\Field(
1387
                        'some_hopefully_unknown_field',
1388
                        Criterion\Operator::BETWEEN,
1389
                        [10, 1000]
1390
                    ),
1391
                    'sortClauses' => [new SortClause\ContentId()],
1392
                ]
1393
            )
1394
        );
1395
    }
1396
1397
    /**
1398
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException

eZ/Publish/API/Repository/Tests/SearchServiceLocationTest.php 1 location

@@ 303-320 (lines=18) @@
300
    /**
301
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
302
     */
303
    public function testInvalidFieldIdentifierRange()
304
    {
305
        $repository = $this->getRepository();
306
        $searchService = $repository->getSearchService();
307
308
        $searchService->findLocations(
309
            new LocationQuery(
310
                [
311
                    'filter' => new Criterion\Field(
312
                        'some_hopefully_unknown_field',
313
                        Criterion\Operator::BETWEEN,
314
                        [10, 1000]
315
                    ),
316
                    'sortClauses' => [new SortClause\ContentId()],
317
                ]
318
            )
319
        );
320
    }
321
322
    /**
323
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException