| @@ 1071-1094 (lines=24) @@ | ||
| 1068 | ); |
|
| 1069 | } |
|
| 1070 | ||
| 1071 | public function testFindNoPerformCount() |
|
| 1072 | { |
|
| 1073 | $repository = $this->getRepository(); |
|
| 1074 | $searchService = $repository->getSearchService(); |
|
| 1075 | ||
| 1076 | $query = new Query(); |
|
| 1077 | $query->performCount = false; |
|
| 1078 | $query->query = new Criterion\ContentTypeId( |
|
| 1079 | [4] |
|
| 1080 | ); |
|
| 1081 | ||
| 1082 | $searchHit = $searchService->findContent($query); |
|
| 1083 | ||
| 1084 | if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
|
| 1085 | $this->assertNull( |
|
| 1086 | $searchHit->totalCount |
|
| 1087 | ); |
|
| 1088 | } else { |
|
| 1089 | $this->assertEquals( |
|
| 1090 | 2, |
|
| 1091 | $searchHit->totalCount |
|
| 1092 | ); |
|
| 1093 | } |
|
| 1094 | } |
|
| 1095 | ||
| 1096 | /** |
|
| 1097 | * @expectedException \RuntimeException |
|
| @@ 1118-1141 (lines=24) @@ | ||
| 1115 | $searchService->findContent($query); |
|
| 1116 | } |
|
| 1117 | ||
| 1118 | public function testFindLocationsNoPerformCount() |
|
| 1119 | { |
|
| 1120 | $repository = $this->getRepository(); |
|
| 1121 | $searchService = $repository->getSearchService(); |
|
| 1122 | ||
| 1123 | $query = new LocationQuery(); |
|
| 1124 | $query->performCount = false; |
|
| 1125 | $query->query = new Criterion\ContentTypeId( |
|
| 1126 | [4] |
|
| 1127 | ); |
|
| 1128 | ||
| 1129 | $searchHit = $searchService->findLocations($query); |
|
| 1130 | ||
| 1131 | if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
|
| 1132 | $this->assertNull( |
|
| 1133 | $searchHit->totalCount |
|
| 1134 | ); |
|
| 1135 | } else { |
|
| 1136 | $this->assertEquals( |
|
| 1137 | 2, |
|
| 1138 | $searchHit->totalCount |
|
| 1139 | ); |
|
| 1140 | } |
|
| 1141 | } |
|
| 1142 | ||
| 1143 | /** |
|
| 1144 | * @expectedException \RuntimeException |
|