| @@ 140-158 (lines=19) @@ | ||
| 137 | * @see \eZ\Publish\API\Repository\SearchService::findLocations() |
|
| 138 | * @depends eZ\Publish\API\Repository\Tests\SearchServiceTest::testFieldCollectionContains |
|
| 139 | */ |
|
| 140 | public function testFieldCollectionContainsNoMatch() |
|
| 141 | { |
|
| 142 | $this->createMultipleCountriesContent(); |
|
| 143 | $query = new LocationQuery( |
|
| 144 | array( |
|
| 145 | 'query' => new Criterion\Field( |
|
| 146 | 'countries', |
|
| 147 | Criterion\Operator::CONTAINS, |
|
| 148 | 'Netherlands Antilles' |
|
| 149 | ), |
|
| 150 | ) |
|
| 151 | ); |
|
| 152 | ||
| 153 | $repository = $this->getRepository(); |
|
| 154 | $searchService = $repository->getSearchService(); |
|
| 155 | $result = $searchService->findLocations($query); |
|
| 156 | ||
| 157 | $this->assertEquals(0, $result->totalCount); |
|
| 158 | } |
|
| 159 | ||
| 160 | /** |
|
| 161 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| @@ 1219-1237 (lines=19) @@ | ||
| 1216 | * @see \eZ\Publish\API\Repository\SearchService::findContent() |
|
| 1217 | * @depends eZ\Publish\API\Repository\Tests\SearchServiceTest::testFieldCollectionContains |
|
| 1218 | */ |
|
| 1219 | public function testFieldCollectionContainsNoMatch() |
|
| 1220 | { |
|
| 1221 | $this->createMultipleCountriesContent(); |
|
| 1222 | $query = new Query( |
|
| 1223 | array( |
|
| 1224 | 'query' => new Criterion\Field( |
|
| 1225 | 'countries', |
|
| 1226 | Criterion\Operator::CONTAINS, |
|
| 1227 | 'Netherlands Antilles' |
|
| 1228 | ), |
|
| 1229 | ) |
|
| 1230 | ); |
|
| 1231 | ||
| 1232 | $repository = $this->getRepository(); |
|
| 1233 | $searchService = $repository->getSearchService(); |
|
| 1234 | $result = $searchService->findContent($query); |
|
| 1235 | ||
| 1236 | $this->assertEquals(0, $result->totalCount); |
|
| 1237 | } |
|
| 1238 | ||
| 1239 | /** |
|
| 1240 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|