Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit 787d31b

Browse files
committed
GraphQl-387: Test coverage of getting IDs of CMS page/blocks by GraphQL API
1 parent 478f438 commit 787d31b

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Page.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ public function getDataByPageIdentifier(string $pageIdentifier): array
8888
}
8989

9090
/**
91+
* Convert page data
92+
*
9193
* @param PageInterface $page
9294
* @return array
9395
* @throws NoSuchEntityException

app/code/Magento/CmsGraphQl/Model/Resolver/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function resolve(
4545
array $value = null,
4646
array $args = null
4747
) {
48-
if (!isset($args['id'], $args['identifier'])) {
48+
if (!isset($args['id']) && !isset($args['identifier'])) {
4949
throw new GraphQlInputException(__('"Page id/identifier should be specified'));
5050
}
5151

dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\TestFramework\TestCase\GraphQlAbstract;
1414
use Magento\Widget\Model\Template\FilterEmulate;
1515

16+
/**
17+
* Get CMS Block test
18+
*/
1619
class CmsBlockTest extends GraphQlAbstract
1720
{
1821
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsPageTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Magento\TestFramework\ObjectManager;
1212
use Magento\TestFramework\TestCase\GraphQlAbstract;
1313

14+
/**
15+
* Get CMS Page test
16+
*/
1417
class CmsPageTest extends GraphQlAbstract
1518
{
1619
/**

0 commit comments

Comments
 (0)