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

@@ 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