Code Duplication    Length = 16-18 lines in 3 locations

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

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

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

@@ 1247-1264 (lines=18) @@
1244
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1245
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field'
1246
     */
1247
    public function testInvalidFieldIdentifierIn()
1248
    {
1249
        $repository = $this->getRepository();
1250
        $searchService = $repository->getSearchService();
1251
1252
        $searchService->findContent(
1253
            new Query(
1254
                array(
1255
                    'filter' => new Criterion\Field(
1256
                        'some_hopefully_unknown_field',
1257
                        Criterion\Operator::EQ,
1258
                        1000
1259
                    ),
1260
                    'sortClauses' => array(new SortClause\ContentId()),
1261
                )
1262
            )
1263
        );
1264
    }
1265
1266
    /**
1267
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1270-1287 (lines=18) @@
1267
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1268
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'tag_cloud_url'
1269
     */
1270
    public function testFindContentWithNonSearchableField()
1271
    {
1272
        $repository = $this->getRepository();
1273
        $searchService = $repository->getSearchService();
1274
1275
        $searchService->findContent(
1276
            new Query(
1277
                array(
1278
                    'filter' => new Criterion\Field(
1279
                        'tag_cloud_url',
1280
                        Criterion\Operator::EQ,
1281
                        'http://nimbus.com'
1282
                    ),
1283
                    'sortClauses' => array(new SortClause\ContentId()),
1284
                )
1285
            )
1286
        );
1287
    }
1288
1289
    /**
1290
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException