Code Duplication    Length = 16-18 lines in 3 locations

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

@@ 1265-1282 (lines=18) @@
1262
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1263
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field'
1264
     */
1265
    public function testInvalidFieldIdentifierIn()
1266
    {
1267
        $repository = $this->getRepository();
1268
        $searchService = $repository->getSearchService();
1269
1270
        $searchService->findContent(
1271
            new Query(
1272
                [
1273
                    'filter' => new Criterion\Field(
1274
                        'some_hopefully_unknown_field',
1275
                        Criterion\Operator::EQ,
1276
                        1000
1277
                    ),
1278
                    'sortClauses' => [new SortClause\ContentId()],
1279
                ]
1280
            )
1281
        );
1282
    }
1283
1284
    /**
1285
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1288-1305 (lines=18) @@
1285
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1286
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'tag_cloud_url'
1287
     */
1288
    public function testFindContentWithNonSearchableField()
1289
    {
1290
        $repository = $this->getRepository();
1291
        $searchService = $repository->getSearchService();
1292
1293
        $searchService->findContent(
1294
            new Query(
1295
                [
1296
                    'filter' => new Criterion\Field(
1297
                        'tag_cloud_url',
1298
                        Criterion\Operator::EQ,
1299
                        'http://nimbus.com'
1300
                    ),
1301
                    'sortClauses' => [new SortClause\ContentId()],
1302
                ]
1303
            )
1304
        );
1305
    }
1306
1307
    /**
1308
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException

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

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