| @@ 127-145 (lines=19) @@ | ||
| 124 | * @see \eZ\Publish\API\Repository\SearchService::findLocations() |
|
| 125 | * @depends eZ\Publish\API\Repository\Tests\SearchServiceTest::testFieldCollectionContains |
|
| 126 | */ |
|
| 127 | public function testFieldCollectionContainsNoMatch() |
|
| 128 | { |
|
| 129 | $this->createMultipleCountriesContent(); |
|
| 130 | $query = new LocationQuery( |
|
| 131 | array( |
|
| 132 | 'query' => new Criterion\Field( |
|
| 133 | 'countries', |
|
| 134 | Criterion\Operator::CONTAINS, |
|
| 135 | 'Netherlands Antilles' |
|
| 136 | ), |
|
| 137 | ) |
|
| 138 | ); |
|
| 139 | ||
| 140 | $repository = $this->getRepository(); |
|
| 141 | $searchService = $repository->getSearchService(); |
|
| 142 | $result = $searchService->findLocations($query); |
|
| 143 | ||
| 144 | $this->assertEquals(0, $result->totalCount); |
|
| 145 | } |
|
| 146 | ||
| 147 | /** |
|
| 148 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| @@ 1200-1218 (lines=19) @@ | ||
| 1197 | * @see \eZ\Publish\API\Repository\SearchService::findContent() |
|
| 1198 | * @depends eZ\Publish\API\Repository\Tests\SearchServiceTest::testFieldCollectionContains |
|
| 1199 | */ |
|
| 1200 | public function testFieldCollectionContainsNoMatch() |
|
| 1201 | { |
|
| 1202 | $this->createMultipleCountriesContent(); |
|
| 1203 | $query = new Query( |
|
| 1204 | array( |
|
| 1205 | 'query' => new Criterion\Field( |
|
| 1206 | 'countries', |
|
| 1207 | Criterion\Operator::CONTAINS, |
|
| 1208 | 'Netherlands Antilles' |
|
| 1209 | ), |
|
| 1210 | ) |
|
| 1211 | ); |
|
| 1212 | ||
| 1213 | $repository = $this->getRepository(); |
|
| 1214 | $searchService = $repository->getSearchService(); |
|
| 1215 | $result = $searchService->findContent($query); |
|
| 1216 | ||
| 1217 | $this->assertEquals(0, $result->totalCount); |
|
| 1218 | } |
|
| 1219 | ||
| 1220 | /** |
|
| 1221 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|