| @@ 2685-2713 (lines=29) @@ | ||
| 2682 | * |
|
| 2683 | * @see \eZ\Publish\API\Repository\SearchService::findContent() |
|
| 2684 | */ |
|
| 2685 | public function testQueryModifiedField() |
|
| 2686 | { |
|
| 2687 | // Check using get_class since the others extend SetupFactory\Legacy |
|
| 2688 | if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
|
| 2689 | $this->markTestIncomplete( |
|
| 2690 | 'Custom fields not supported by LegacySE ' . |
|
| 2691 | '(@todo: Legacy should fallback to just querying normal field so this should be tested here)' |
|
| 2692 | ); |
|
| 2693 | } |
|
| 2694 | ||
| 2695 | $query = new Query( |
|
| 2696 | [ |
|
| 2697 | 'query' => new Criterion\Field( |
|
| 2698 | 'first_name', |
|
| 2699 | Criterion\Operator::EQ, |
|
| 2700 | 'User' |
|
| 2701 | ), |
|
| 2702 | 'offset' => 0, |
|
| 2703 | 'limit' => 10, |
|
| 2704 | 'sortClauses' => [new SortClause\ContentId()], |
|
| 2705 | ] |
|
| 2706 | ); |
|
| 2707 | $query->query->setCustomField('user', 'first_name', 'custom_field'); |
|
| 2708 | ||
| 2709 | $this->assertQueryFixture( |
|
| 2710 | $query, |
|
| 2711 | $this->getFixtureDir() . '/QueryModifiedField.php' |
|
| 2712 | ); |
|
| 2713 | } |
|
| 2714 | ||
| 2715 | /** |
|
| 2716 | * Test for the findContent() method. |
|
| @@ 417-447 (lines=31) @@ | ||
| 414 | * |
|
| 415 | * @see \eZ\Publish\API\Repository\SearchService::findLocations() |
|
| 416 | */ |
|
| 417 | public function testQueryModifiedField() |
|
| 418 | { |
|
| 419 | // Check using get_class since the others extend SetupFactory\Legacy |
|
| 420 | if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
|
| 421 | $this->markTestIncomplete( |
|
| 422 | 'Custom fields not supported by LegacySE ' . |
|
| 423 | '(@todo: Legacy should fallback to just querying normal field so this should be tested here)' |
|
| 424 | ); |
|
| 425 | } |
|
| 426 | ||
| 427 | $query = new LocationQuery( |
|
| 428 | [ |
|
| 429 | 'query' => new Criterion\Field( |
|
| 430 | 'first_name', |
|
| 431 | Criterion\Operator::EQ, |
|
| 432 | 'User' |
|
| 433 | ), |
|
| 434 | 'offset' => 0, |
|
| 435 | 'limit' => 10, |
|
| 436 | 'sortClauses' => [new SortClause\ContentId()], |
|
| 437 | ] |
|
| 438 | ); |
|
| 439 | $query->query->setCustomField('user', 'first_name', 'custom_field'); |
|
| 440 | ||
| 441 | $this->assertQueryFixture( |
|
| 442 | $query, |
|
| 443 | $this->getFixtureDir() . '/QueryModifiedField.php', |
|
| 444 | null, |
|
| 445 | true |
|
| 446 | ); |
|
| 447 | } |
|
| 448 | ||
| 449 | /** |
|
| 450 | * @return \eZ\Publish\API\Repository\Values\ContentType\ContentType |
|