| @@ 454-469 (lines=16) @@ | ||
| 451 | /** |
|
| 452 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| 453 | */ |
|
| 454 | public function testFindContentWithNonSearchableField() |
|
| 455 | { |
|
| 456 | $locator = $this->getContentSearchHandler(); |
|
| 457 | $locator->findContent( |
|
| 458 | new Query( |
|
| 459 | array( |
|
| 460 | 'filter' => new Criterion\Field( |
|
| 461 | 'tag_cloud_url', |
|
| 462 | Criterion\Operator::EQ, |
|
| 463 | 'http://nimbus.com' |
|
| 464 | ), |
|
| 465 | 'sortClauses' => array(new SortClause\ContentId()), |
|
| 466 | ) |
|
| 467 | ) |
|
| 468 | ); |
|
| 469 | } |
|
| 470 | ||
| 471 | /** |
|
| 472 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| @@ 1263-1280 (lines=18) @@ | ||
| 1260 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| 1261 | * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field' |
|
| 1262 | */ |
|
| 1263 | public function testInvalidFieldIdentifierIn() |
|
| 1264 | { |
|
| 1265 | $repository = $this->getRepository(); |
|
| 1266 | $searchService = $repository->getSearchService(); |
|
| 1267 | ||
| 1268 | $searchService->findContent( |
|
| 1269 | new Query( |
|
| 1270 | array( |
|
| 1271 | 'filter' => new Criterion\Field( |
|
| 1272 | 'some_hopefully_unknown_field', |
|
| 1273 | Criterion\Operator::EQ, |
|
| 1274 | 1000 |
|
| 1275 | ), |
|
| 1276 | 'sortClauses' => array(new SortClause\ContentId()), |
|
| 1277 | ) |
|
| 1278 | ) |
|
| 1279 | ); |
|
| 1280 | } |
|
| 1281 | ||
| 1282 | /** |
|
| 1283 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| @@ 1286-1303 (lines=18) @@ | ||
| 1283 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| 1284 | * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'tag_cloud_url' |
|
| 1285 | */ |
|
| 1286 | public function testFindContentWithNonSearchableField() |
|
| 1287 | { |
|
| 1288 | $repository = $this->getRepository(); |
|
| 1289 | $searchService = $repository->getSearchService(); |
|
| 1290 | ||
| 1291 | $searchService->findContent( |
|
| 1292 | new Query( |
|
| 1293 | array( |
|
| 1294 | 'filter' => new Criterion\Field( |
|
| 1295 | 'tag_cloud_url', |
|
| 1296 | Criterion\Operator::EQ, |
|
| 1297 | 'http://nimbus.com' |
|
| 1298 | ), |
|
| 1299 | 'sortClauses' => array(new SortClause\ContentId()), |
|
| 1300 | ) |
|
| 1301 | ) |
|
| 1302 | ); |
|
| 1303 | } |
|
| 1304 | ||
| 1305 | /** |
|
| 1306 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|