From 548bbd4a3f924de02c1e013c42a6bd1a33f3d486 Mon Sep 17 00:00:00 2001 From: Tomasz Kryszan Date: Fri, 22 Dec 2023 12:32:09 +0100 Subject: [PATCH] [Tests] Added functional tests coverage --- .../SearchView/Criterion/ContentNameTest.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/bundle/Functional/SearchView/Criterion/ContentNameTest.php diff --git a/tests/bundle/Functional/SearchView/Criterion/ContentNameTest.php b/tests/bundle/Functional/SearchView/Criterion/ContentNameTest.php new file mode 100644 index 00000000..18b2491d --- /dev/null +++ b/tests/bundle/Functional/SearchView/Criterion/ContentNameTest.php @@ -0,0 +1,47 @@ +createFolder('foo', '/api/ibexa/v2/content/locations/1/2'); + $this->createFolder('foobar', '/api/ibexa/v2/content/locations/1/2'); + } + + /** + * @return iterable + */ + public function getCriteriaPayloads(): iterable + { + yield 'Return content items that contain "foo" in name' => [ + 'json', + $this->buildJsonCriterionQuery('"ContentNameCriterion": "foo*"'), + 2, + ]; + + yield 'No content items found with article in name' => [ + 'json', + $this->buildJsonCriterionQuery('"ContentNameCriterion": "*article*"'), + 0, + ]; + } +}