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