Code Duplication    Length = 16-18 lines in 3 locations

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

@@ 454-469 (lines=16) @@
451
    /**
452
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
453
     */
454
    public function testFindContentWithNonSearchableField()
455
    {
456
        $locator = $this->getContentSearchHandler();
457
        $locator->findContent(
458
            new Query(
459
                array(
460
                    'filter' => new Criterion\Field(
461
                        'tag_cloud_url',
462
                        Criterion\Operator::EQ,
463
                        'http://nimbus.com'
464
                    ),
465
                    'sortClauses' => array(new SortClause\ContentId()),
466
                )
467
            )
468
        );
469
    }
470
471
    /**
472
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException

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

@@ 1330-1347 (lines=18) @@
1327
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1328
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field'
1329
     */
1330
    public function testInvalidFieldIdentifierIn()
1331
    {
1332
        $repository = $this->getRepository();
1333
        $searchService = $repository->getSearchService();
1334
1335
        $searchService->findContent(
1336
            new Query(
1337
                array(
1338
                    'filter' => new Criterion\Field(
1339
                        'some_hopefully_unknown_field',
1340
                        Criterion\Operator::EQ,
1341
                        1000
1342
                    ),
1343
                    'sortClauses' => array(new SortClause\ContentId()),
1344
                )
1345
            )
1346
        );
1347
    }
1348
1349
    /**
1350
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1353-1370 (lines=18) @@
1350
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1351
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'tag_cloud_url'
1352
     */
1353
    public function testFindContentWithNonSearchableField()
1354
    {
1355
        $repository = $this->getRepository();
1356
        $searchService = $repository->getSearchService();
1357
1358
        $searchService->findContent(
1359
            new Query(
1360
                array(
1361
                    'filter' => new Criterion\Field(
1362
                        'tag_cloud_url',
1363
                        Criterion\Operator::EQ,
1364
                        'http://nimbus.com'
1365
                    ),
1366
                    'sortClauses' => array(new SortClause\ContentId()),
1367
                )
1368
            )
1369
        );
1370
    }
1371
1372
    /**
1373
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException