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
                [
460
                    'filter' => new Criterion\Field(
461
                        'tag_cloud_url',
462
                        Criterion\Operator::EQ,
463
                        'http://nimbus.com'
464
                    ),
465
                    'sortClauses' => [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

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