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

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