| @@ 125-143 (lines=19) @@ | ||
| 122 | * @see \eZ\Publish\API\Repository\SearchService::findLocations() |
|
| 123 | * @depends eZ\Publish\API\Repository\Tests\SearchServiceTest::testFieldCollectionContains |
|
| 124 | */ |
|
| 125 | public function testFieldCollectionContainsNoMatch() |
|
| 126 | { |
|
| 127 | $this->createMultipleCountriesContent(); |
|
| 128 | $query = new LocationQuery( |
|
| 129 | array( |
|
| 130 | 'query' => new Criterion\Field( |
|
| 131 | 'countries', |
|
| 132 | Criterion\Operator::CONTAINS, |
|
| 133 | 'Netherlands Antilles' |
|
| 134 | ), |
|
| 135 | ) |
|
| 136 | ); |
|
| 137 | ||
| 138 | $repository = $this->getRepository(); |
|
| 139 | $searchService = $repository->getSearchService(); |
|
| 140 | $result = $searchService->findLocations($query); |
|
| 141 | ||
| 142 | $this->assertEquals(0, $result->totalCount); |
|
| 143 | } |
|
| 144 | ||
| 145 | /** |
|
| 146 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| @@ 1216-1234 (lines=19) @@ | ||
| 1213 | * @see \eZ\Publish\API\Repository\SearchService::findContent() |
|
| 1214 | * @depends eZ\Publish\API\Repository\Tests\SearchServiceTest::testFieldCollectionContains |
|
| 1215 | */ |
|
| 1216 | public function testFieldCollectionContainsNoMatch() |
|
| 1217 | { |
|
| 1218 | $this->createMultipleCountriesContent(); |
|
| 1219 | $query = new Query( |
|
| 1220 | array( |
|
| 1221 | 'query' => new Criterion\Field( |
|
| 1222 | 'countries', |
|
| 1223 | Criterion\Operator::CONTAINS, |
|
| 1224 | 'Netherlands Antilles' |
|
| 1225 | ), |
|
| 1226 | ) |
|
| 1227 | ); |
|
| 1228 | ||
| 1229 | $repository = $this->getRepository(); |
|
| 1230 | $searchService = $repository->getSearchService(); |
|
| 1231 | $result = $searchService->findContent($query); |
|
| 1232 | ||
| 1233 | $this->assertEquals(0, $result->totalCount); |
|
| 1234 | } |
|
| 1235 | ||
| 1236 | /** |
|
| 1237 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|