| @@ 1430-1447 (lines=18) @@ | ||
| 1427 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| 1428 | * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'some_hopefully_unknown_field' |
|
| 1429 | */ |
|
| 1430 | public function testInvalidFieldIdentifierIn() |
|
| 1431 | { |
|
| 1432 | $repository = $this->getRepository(); |
|
| 1433 | $searchService = $repository->getSearchService(); |
|
| 1434 | ||
| 1435 | $searchService->findContent( |
|
| 1436 | new Query( |
|
| 1437 | [ |
|
| 1438 | 'filter' => new Criterion\Field( |
|
| 1439 | 'some_hopefully_unknown_field', |
|
| 1440 | Criterion\Operator::EQ, |
|
| 1441 | 1000 |
|
| 1442 | ), |
|
| 1443 | 'sortClauses' => [new SortClause\ContentId()], |
|
| 1444 | ] |
|
| 1445 | ) |
|
| 1446 | ); |
|
| 1447 | } |
|
| 1448 | ||
| 1449 | /** |
|
| 1450 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| @@ 1453-1470 (lines=18) @@ | ||
| 1450 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| 1451 | * @expectedExceptionMessage Argument '$criterion->target' is invalid: No searchable fields found for the given criterion target 'tag_cloud_url' |
|
| 1452 | */ |
|
| 1453 | public function testFindContentWithNonSearchableField() |
|
| 1454 | { |
|
| 1455 | $repository = $this->getRepository(); |
|
| 1456 | $searchService = $repository->getSearchService(); |
|
| 1457 | ||
| 1458 | $searchService->findContent( |
|
| 1459 | new Query( |
|
| 1460 | [ |
|
| 1461 | 'filter' => new Criterion\Field( |
|
| 1462 | 'tag_cloud_url', |
|
| 1463 | Criterion\Operator::EQ, |
|
| 1464 | 'http://nimbus.com' |
|
| 1465 | ), |
|
| 1466 | 'sortClauses' => [new SortClause\ContentId()], |
|
| 1467 | ] |
|
| 1468 | ) |
|
| 1469 | ); |
|
| 1470 | } |
|
| 1471 | ||
| 1472 | /** |
|
| 1473 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| @@ 372-387 (lines=16) @@ | ||
| 369 | /** |
|
| 370 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| 371 | */ |
|
| 372 | public function testFindContentWithNonSearchableField() |
|
| 373 | { |
|
| 374 | $locator = $this->getContentSearchHandler(); |
|
| 375 | $locator->findContent( |
|
| 376 | new Query( |
|
| 377 | [ |
|
| 378 | 'filter' => new Criterion\Field( |
|
| 379 | 'tag_cloud_url', |
|
| 380 | Criterion\Operator::EQ, |
|
| 381 | 'http://nimbus.com' |
|
| 382 | ), |
|
| 383 | 'sortClauses' => [new SortClause\ContentId()], |
|
| 384 | ] |
|
| 385 | ) |
|
| 386 | ); |
|
| 387 | } |
|
| 388 | ||
| 389 | /** |
|
| 390 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|