| @@ 1039-1062 (lines=24) @@ | ||
| 1036 | ); |
|
| 1037 | } |
|
| 1038 | ||
| 1039 | public function testFindNoPerformCount() |
|
| 1040 | { |
|
| 1041 | $repository = $this->getRepository(); |
|
| 1042 | $searchService = $repository->getSearchService(); |
|
| 1043 | ||
| 1044 | $query = new Query(); |
|
| 1045 | $query->performCount = false; |
|
| 1046 | $query->query = new Criterion\ContentTypeId( |
|
| 1047 | [4] |
|
| 1048 | ); |
|
| 1049 | ||
| 1050 | $searchHit = $searchService->findContent($query); |
|
| 1051 | ||
| 1052 | if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
|
| 1053 | $this->assertNull( |
|
| 1054 | $searchHit->totalCount |
|
| 1055 | ); |
|
| 1056 | } else { |
|
| 1057 | $this->assertEquals( |
|
| 1058 | 2, |
|
| 1059 | $searchHit->totalCount |
|
| 1060 | ); |
|
| 1061 | } |
|
| 1062 | } |
|
| 1063 | ||
| 1064 | /** |
|
| 1065 | * @expectedException \RuntimeException |
|
| @@ 1086-1109 (lines=24) @@ | ||
| 1083 | $searchService->findContent($query); |
|
| 1084 | } |
|
| 1085 | ||
| 1086 | public function testFindLocationsNoPerformCount() |
|
| 1087 | { |
|
| 1088 | $repository = $this->getRepository(); |
|
| 1089 | $searchService = $repository->getSearchService(); |
|
| 1090 | ||
| 1091 | $query = new LocationQuery(); |
|
| 1092 | $query->performCount = false; |
|
| 1093 | $query->query = new Criterion\ContentTypeId( |
|
| 1094 | [4] |
|
| 1095 | ); |
|
| 1096 | ||
| 1097 | $searchHit = $searchService->findLocations($query); |
|
| 1098 | ||
| 1099 | if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
|
| 1100 | $this->assertNull( |
|
| 1101 | $searchHit->totalCount |
|
| 1102 | ); |
|
| 1103 | } else { |
|
| 1104 | $this->assertEquals( |
|
| 1105 | 2, |
|
| 1106 | $searchHit->totalCount |
|
| 1107 | ); |
|
| 1108 | } |
|
| 1109 | } |
|
| 1110 | ||
| 1111 | /** |
|
| 1112 | * @expectedException \RuntimeException |
|