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 7206904
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/bundle/Functional/SearchView/Criterion/ContentNameTest.php
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,
];
}
}

0 comments on commit 7206904

Please sign in to comment.