Code Duplication    Length = 23-31 lines in 3 locations

eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerContentTest.php 3 locations

@@ 370-392 (lines=23) @@
367
    /**
368
     * Issue with PHP_MAX_INT limit overflow in databases.
369
     */
370
    public function testFindWithNullLimit()
371
    {
372
        $locator = $this->getContentSearchHandler();
373
374
        $result = $locator->findContent(
375
            new Query(
376
                array(
377
                    'filter' => new Criterion\ContentId(10),
378
                    'offset' => 0,
379
                    'limit' => null,
380
                )
381
            )
382
        );
383
384
        $this->assertEquals(
385
            1,
386
            $result->totalCount
387
        );
388
        $this->assertEquals(
389
            1,
390
            count($result->searchHits)
391
        );
392
    }
393
394
    /**
395
     * Issue with offsetting to the nonexistent results produces \ezcQueryInvalidParameterException exception.
@@ 397-419 (lines=23) @@
394
    /**
395
     * Issue with offsetting to the nonexistent results produces \ezcQueryInvalidParameterException exception.
396
     */
397
    public function testFindWithOffsetToNonexistent()
398
    {
399
        $locator = $this->getContentSearchHandler();
400
401
        $result = $locator->findContent(
402
            new Query(
403
                array(
404
                    'filter' => new Criterion\ContentId(10),
405
                    'offset' => 1000,
406
                    'limit' => null,
407
                )
408
            )
409
        );
410
411
        $this->assertEquals(
412
            1,
413
            $result->totalCount
414
        );
415
        $this->assertEquals(
416
            0,
417
            count($result->searchHits)
418
        );
419
    }
420
421
    public function testFindSingle()
422
    {
@@ 1092-1122 (lines=31) @@
1089
        );
1090
    }
1091
1092
    public function testFullTextFilterNoStopwordRemoval()
1093
    {
1094
        $handler = $this->getContentSearchHandler(
1095
            array(
1096
                'stopWordThresholdFactor' => 1,
1097
            )
1098
        );
1099
1100
        $result = $handler->findContent(
1101
            new Query(
1102
                array(
1103
                    'filter' => new Criterion\FullText(
1104
                        'the'
1105
                    ),
1106
                    'limit' => 10,
1107
                )
1108
            )
1109
        );
1110
1111
        $this->assertEquals(
1112
            10,
1113
            count(
1114
                array_map(
1115
                    function ($hit) {
1116
                        return $hit->valueObject->id;
1117
                    },
1118
                    $result->searchHits
1119
                )
1120
            )
1121
        );
1122
    }
1123
1124
    /**
1125
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException