Code Duplication    Length = 18-18 lines in 2 locations

eZ/Publish/API/Repository/Tests/SearchServiceLocationTest.php 1 location

@@ 150-167 (lines=18) @@
147
    /**
148
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
149
     */
150
    public function testInvalidFieldIdentifierRange()
151
    {
152
        $repository = $this->getRepository();
153
        $searchService = $repository->getSearchService();
154
155
        $searchService->findLocations(
156
            new LocationQuery(
157
                array(
158
                    'filter' => new Criterion\Field(
159
                        'some_hopefully_unknown_field',
160
                        Criterion\Operator::BETWEEN,
161
                        array(10, 1000)
162
                    ),
163
                    'sortClauses' => array(new SortClause\ContentId()),
164
                )
165
            )
166
        );
167
    }
168
169
    /**
170
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException

eZ/Publish/API/Repository/Tests/SearchServiceTest.php 1 location

@@ 1222-1239 (lines=18) @@
1219
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
1220
     * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field'
1221
     */
1222
    public function testInvalidFieldIdentifierRange()
1223
    {
1224
        $repository = $this->getRepository();
1225
        $searchService = $repository->getSearchService();
1226
1227
        $searchService->findContent(
1228
            new Query(
1229
                array(
1230
                    'filter' => new Criterion\Field(
1231
                        'some_hopefully_unknown_field',
1232
                        Criterion\Operator::BETWEEN,
1233
                        array(10, 1000)
1234
                    ),
1235
                    'sortClauses' => array(new SortClause\ContentId()),
1236
                )
1237
            )
1238
        );
1239
    }
1240
1241
    /**
1242
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException