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