Code Duplication    Length = 16-18 lines in 3 locations

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

@@ 1135-1152 (lines=18) @@
1132
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1133
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field'
1134
     */
1135
    public function testInvalidFieldIdentifierIn()
1136
    {
1137
        $repository = $this->getRepository();
1138
        $searchService = $repository->getSearchService();
1139
1140
        $searchService->findContent(
1141
            new Query(
1142
                array(
1143
                    'filter' => new Criterion\Field(
1144
                        'some_hopefully_unknown_field',
1145
                        Criterion\Operator::EQ,
1146
                        1000
1147
                    ),
1148
                    'sortClauses' => array(new SortClause\ContentId()),
1149
                )
1150
            )
1151
        );
1152
    }
1153
1154
    /**
1155
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
@@ 1158-1175 (lines=18) @@
1155
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1156
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'tag_cloud_url'
1157
     */
1158
    public function testFindContentWithNonSearchableField()
1159
    {
1160
        $repository = $this->getRepository();
1161
        $searchService = $repository->getSearchService();
1162
1163
        $searchService->findContent(
1164
            new Query(
1165
                array(
1166
                    'filter' => new Criterion\Field(
1167
                        'tag_cloud_url',
1168
                        Criterion\Operator::EQ,
1169
                        'http://nimbus.com'
1170
                    ),
1171
                    'sortClauses' => array(new SortClause\ContentId()),
1172
                )
1173
            )
1174
        );
1175
    }
1176
1177
    /**
1178
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException

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