Skip to content

Commit 4ee64a5

Browse files
committed
387-Test coverage of getting IDs of CMS page/blocks by GraphQL API
1 parent b4ea6b9 commit 4ee64a5

File tree

1 file changed

+5
-6
lines changed
  • app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Magento\Cms\Api\Data\PageInterface;
1111
use Magento\Cms\Api\GetPageByIdentifierInterface;
1212
use Magento\Cms\Api\PageRepositoryInterface;
13-
use Magento\Framework\App\ObjectManager;
1413
use Magento\Framework\Exception\NoSuchEntityException;
1514
use Magento\Store\Model\StoreManagerInterface;
1615
use Magento\Widget\Model\Template\FilterEmulate;
@@ -49,14 +48,14 @@ class Page
4948
public function __construct(
5049
PageRepositoryInterface $pageRepository,
5150
FilterEmulate $widgetFilter,
52-
GetPageByIdentifierInterface $getPageByIdentifier = null,
53-
StoreManagerInterface $storeManager = null
51+
GetPageByIdentifierInterface $getPageByIdentifier,
52+
StoreManagerInterface $storeManager
5453
) {
5554

5655
$this->pageRepository = $pageRepository;
5756
$this->widgetFilter = $widgetFilter;
58-
$this->pageByIdentifier = $getPageByIdentifier ?: ObjectManager::getInstance()->get(GetPageByIdentifierInterface::class);
59-
$this->storeManager = $storeManager ?: ObjectManager::getInstance()->get(StoreManagerInterface::class);
57+
$this->pageByIdentifier = $getPageByIdentifier;
58+
$this->storeManager = $storeManager;
6059
}
6160

6261
/**
@@ -72,7 +71,7 @@ public function __construct(
7271
public function getData(int $pageId): array
7372
{
7473
$page = $this->pageRepository->getById($pageId);
75-
74+
7675
return $this->convertPageData($page);
7776
}
7877

0 commit comments

Comments
 (0)