| @@ 1019-1043 (lines=25) @@ | ||
| 1016 | ); |
|
| 1017 | } |
|
| 1018 | ||
| 1019 | public function testFindNoPerformCount() |
|
| 1020 | { |
|
| 1021 | $repository = $this->getRepository(); |
|
| 1022 | $searchService = $repository->getSearchService(); |
|
| 1023 | ||
| 1024 | $query = new Query(); |
|
| 1025 | $query->performCount = false; |
|
| 1026 | $query->query = new Criterion\ContentTypeId( |
|
| 1027 | array(4) |
|
| 1028 | ); |
|
| 1029 | ||
| 1030 | $searchHit = $searchService->findContent($query); |
|
| 1031 | ||
| 1032 | if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
|
| 1033 | $this->assertEquals( |
|
| 1034 | null, |
|
| 1035 | $searchHit->totalCount |
|
| 1036 | ); |
|
| 1037 | } else { |
|
| 1038 | $this->assertEquals( |
|
| 1039 | 2, |
|
| 1040 | $searchHit->totalCount |
|
| 1041 | ); |
|
| 1042 | } |
|
| 1043 | } |
|
| 1044 | ||
| 1045 | /** |
|
| 1046 | * @expectedException \RuntimeException |
|
| @@ 1067-1091 (lines=25) @@ | ||
| 1064 | $searchService->findContent($query); |
|
| 1065 | } |
|
| 1066 | ||
| 1067 | public function testFindLocationsNoPerformCount() |
|
| 1068 | { |
|
| 1069 | $repository = $this->getRepository(); |
|
| 1070 | $searchService = $repository->getSearchService(); |
|
| 1071 | ||
| 1072 | $query = new LocationQuery(); |
|
| 1073 | $query->performCount = false; |
|
| 1074 | $query->query = new Criterion\ContentTypeId( |
|
| 1075 | array(4) |
|
| 1076 | ); |
|
| 1077 | ||
| 1078 | $searchHit = $searchService->findLocations($query); |
|
| 1079 | ||
| 1080 | if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
|
| 1081 | $this->assertEquals( |
|
| 1082 | null, |
|
| 1083 | $searchHit->totalCount |
|
| 1084 | ); |
|
| 1085 | } else { |
|
| 1086 | $this->assertEquals( |
|
| 1087 | 2, |
|
| 1088 | $searchHit->totalCount |
|
| 1089 | ); |
|
| 1090 | } |
|
| 1091 | } |
|
| 1092 | ||
| 1093 | /** |
|
| 1094 | * @expectedException \RuntimeException |
|