Code Duplication    Length = 16-18 lines in 3 locations

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

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

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