Code Duplication    Length = 16-18 lines in 3 locations

eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerContentTest.php 1 location

@@ 368-383 (lines=16) @@
365
    /**
366
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
367
     */
368
    public function testFindContentWithNonSearchableField()
369
    {
370
        $locator = $this->getContentSearchHandler();
371
        $locator->findContent(
372
            new Query(
373
                [
374
                    'filter' => new Criterion\Field(
375
                        'tag_cloud_url',
376
                        Criterion\Operator::EQ,
377
                        'http://nimbus.com'
378
                    ),
379
                    'sortClauses' => [new SortClause\ContentId()],
380
                ]
381
            )
382
        );
383
    }
384
385
    /**
386
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException

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

@@ 1401-1418 (lines=18) @@
1398
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1399
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field'
1400
     */
1401
    public function testInvalidFieldIdentifierIn()
1402
    {
1403
        $repository = $this->getRepository();
1404
        $searchService = $repository->getSearchService();
1405
1406
        $searchService->findContent(
1407
            new Query(
1408
                [
1409
                    'filter' => new Criterion\Field(
1410
                        'some_hopefully_unknown_field',
1411
                        Criterion\Operator::EQ,
1412
                        1000
1413
                    ),
1414
                    'sortClauses' => [new SortClause\ContentId()],
1415
                ]
1416
            )
1417
        );
1418
    }
1419
1420
    /**
1421
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1424-1441 (lines=18) @@
1421
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1422
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'tag_cloud_url'
1423
     */
1424
    public function testFindContentWithNonSearchableField()
1425
    {
1426
        $repository = $this->getRepository();
1427
        $searchService = $repository->getSearchService();
1428
1429
        $searchService->findContent(
1430
            new Query(
1431
                [
1432
                    'filter' => new Criterion\Field(
1433
                        'tag_cloud_url',
1434
                        Criterion\Operator::EQ,
1435
                        'http://nimbus.com'
1436
                    ),
1437
                    'sortClauses' => [new SortClause\ContentId()],
1438
                ]
1439
            )
1440
        );
1441
    }
1442
1443
    /**
1444
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException