-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tests] Added functional tests coverage
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
tests/bundle/Functional/SearchView/Criterion/ContentNameTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Tests\Bundle\Rest\Functional\SearchView\Criterion; | ||
|
||
use Ibexa\Tests\Bundle\Rest\Functional\SearchView\SearchCriterionTestCase; | ||
|
||
/** | ||
* @covers \Ibexa\Rest\Server\Input\Parser\Criterion\ContentName | ||
*/ | ||
final class ContentNameTest extends SearchCriterionTestCase | ||
{ | ||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->createFolder('foo', '/api/ibexa/v2/content/locations/1/2'); | ||
} | ||
|
||
/** | ||
* @return iterable<array{ | ||
* string, | ||
* string, | ||
* int, | ||
* }> | ||
*/ | ||
public function getCriteriaPayloads(): iterable | ||
{ | ||
yield 'Return content items that contain "foo" in name' => [ | ||
'json', | ||
$this->buildJsonCriterionQuery('"ContentNameCriterion": "foo*"'), | ||
1, | ||
]; | ||
|
||
yield 'No content items found with article in name' => [ | ||
'json', | ||
$this->buildJsonCriterionQuery('"ContentNameCriterion": "*article*"'), | ||
0, | ||
]; | ||
} | ||
} |