Skip to content

Commit

Permalink
[Tests] Added functional tests coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ciastektk committed Dec 22, 2023
1 parent d859335 commit 3d4dad4
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/bundle/Functional/SearchView/Criterion/ContentNameTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?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
{
/**
* @return iterable<array{
* string,
* string,
* int,
* }>
*/
public function getCriteriaPayloads(): iterable
{
yield 'Return content items that contain "test" in name' => [
'json',
$this->buildJsonCriterionQuery('"ContentNameCriterion": "test*"'),
3,
];

yield 'No content items found with article in name' => [
'json',
$this->buildJsonCriterionQuery('"ContentNameCriterion": "*article*"'),
0,
];
}
}

0 comments on commit 3d4dad4

Please sign in to comment.