Code Duplication    Length = 18-18 lines in 2 locations

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

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

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

@@ 1412-1429 (lines=18) @@
1409
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1410
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field'
1411
     */
1412
    public function testInvalidFieldIdentifierRange()
1413
    {
1414
        $repository = $this->getRepository();
1415
        $searchService = $repository->getSearchService();
1416
1417
        $searchService->findContent(
1418
            new Query(
1419
                [
1420
                    'filter' => new Criterion\Field(
1421
                        'some_hopefully_unknown_field',
1422
                        Criterion\Operator::BETWEEN,
1423
                        [10, 1000]
1424
                    ),
1425
                    'sortClauses' => [new SortClause\ContentId()],
1426
                ]
1427
            )
1428
        );
1429
    }
1430
1431
    /**
1432
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException