| @@ 290-312 (lines=23) @@ | ||
| 287 | /** |
|
| 288 | * Issue with PHP_MAX_INT limit overflow in databases. |
|
| 289 | */ |
|
| 290 | public function testFindWithNullLimit() |
|
| 291 | { |
|
| 292 | $locator = $this->getContentSearchHandler(); |
|
| 293 | ||
| 294 | $result = $locator->findContent( |
|
| 295 | new Query( |
|
| 296 | array( |
|
| 297 | 'filter' => new Criterion\ContentId(10), |
|
| 298 | 'offset' => 0, |
|
| 299 | 'limit' => null, |
|
| 300 | ) |
|
| 301 | ) |
|
| 302 | ); |
|
| 303 | ||
| 304 | $this->assertEquals( |
|
| 305 | 1, |
|
| 306 | $result->totalCount |
|
| 307 | ); |
|
| 308 | $this->assertEquals( |
|
| 309 | 1, |
|
| 310 | count($result->searchHits) |
|
| 311 | ); |
|
| 312 | } |
|
| 313 | ||
| 314 | /** |
|
| 315 | * Issue with offsetting to the nonexistent results produces \ezcQueryInvalidParameterException exception. |
|
| @@ 317-339 (lines=23) @@ | ||
| 314 | /** |
|
| 315 | * Issue with offsetting to the nonexistent results produces \ezcQueryInvalidParameterException exception. |
|
| 316 | */ |
|
| 317 | public function testFindWithOffsetToNonexistent() |
|
| 318 | { |
|
| 319 | $locator = $this->getContentSearchHandler(); |
|
| 320 | ||
| 321 | $result = $locator->findContent( |
|
| 322 | new Query( |
|
| 323 | array( |
|
| 324 | 'filter' => new Criterion\ContentId(10), |
|
| 325 | 'offset' => 1000, |
|
| 326 | 'limit' => null, |
|
| 327 | ) |
|
| 328 | ) |
|
| 329 | ); |
|
| 330 | ||
| 331 | $this->assertEquals( |
|
| 332 | 1, |
|
| 333 | $result->totalCount |
|
| 334 | ); |
|
| 335 | $this->assertEquals( |
|
| 336 | 0, |
|
| 337 | count($result->searchHits) |
|
| 338 | ); |
|
| 339 | } |
|
| 340 | ||
| 341 | public function testFindSingle() |
|
| 342 | { |
|
| @@ 1012-1042 (lines=31) @@ | ||
| 1009 | ); |
|
| 1010 | } |
|
| 1011 | ||
| 1012 | public function testFullTextFilterNoStopwordRemoval() |
|
| 1013 | { |
|
| 1014 | $handler = $this->getContentSearchHandler( |
|
| 1015 | array( |
|
| 1016 | 'stopWordThresholdFactor' => 1, |
|
| 1017 | ) |
|
| 1018 | ); |
|
| 1019 | ||
| 1020 | $result = $handler->findContent( |
|
| 1021 | new Query( |
|
| 1022 | array( |
|
| 1023 | 'filter' => new Criterion\FullText( |
|
| 1024 | 'the' |
|
| 1025 | ), |
|
| 1026 | 'limit' => 10, |
|
| 1027 | ) |
|
| 1028 | ) |
|
| 1029 | ); |
|
| 1030 | ||
| 1031 | $this->assertEquals( |
|
| 1032 | 10, |
|
| 1033 | count( |
|
| 1034 | array_map( |
|
| 1035 | function ($hit) { |
|
| 1036 | return $hit->valueObject->id; |
|
| 1037 | }, |
|
| 1038 | $result->searchHits |
|
| 1039 | ) |
|
| 1040 | ) |
|
| 1041 | ); |
|
| 1042 | } |
|
| 1043 | ||
| 1044 | /** |
|
| 1045 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|