Code Duplication    Length = 16-18 lines in 3 locations

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

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

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

@@ 1435-1452 (lines=18) @@
1432
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1433
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field'
1434
     */
1435
    public function testInvalidFieldIdentifierIn()
1436
    {
1437
        $repository = $this->getRepository();
1438
        $searchService = $repository->getSearchService();
1439
1440
        $searchService->findContent(
1441
            new Query(
1442
                [
1443
                    'filter' => new Criterion\Field(
1444
                        'some_hopefully_unknown_field',
1445
                        Criterion\Operator::EQ,
1446
                        1000
1447
                    ),
1448
                    'sortClauses' => [new SortClause\ContentId()],
1449
                ]
1450
            )
1451
        );
1452
    }
1453
1454
    /**
1455
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1458-1475 (lines=18) @@
1455
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1456
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'tag_cloud_url'
1457
     */
1458
    public function testFindContentWithNonSearchableField()
1459
    {
1460
        $repository = $this->getRepository();
1461
        $searchService = $repository->getSearchService();
1462
1463
        $searchService->findContent(
1464
            new Query(
1465
                [
1466
                    'filter' => new Criterion\Field(
1467
                        'tag_cloud_url',
1468
                        Criterion\Operator::EQ,
1469
                        'http://nimbus.com'
1470
                    ),
1471
                    'sortClauses' => [new SortClause\ContentId()],
1472
                ]
1473
            )
1474
        );
1475
    }
1476
1477
    /**
1478
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException