Code Duplication    Length = 16-18 lines in 3 locations

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

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

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

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