/**
  * Test delete \Magento\Cms\Api\Data\PageInterface
  * @expectedException \Magento\Framework\Exception\NoSuchEntityException
  */
 public function testDelete()
 {
     $pageTitle = 'Page title';
     $pageIdentifier = 'page-title' . uniqid();
     /** @var  \Magento\Cms\Api\Data\PageInterface $pageDataObject */
     $pageDataObject = $this->pageFactory->create();
     $pageDataObject->setTitle($pageTitle)->setIdentifier($pageIdentifier);
     $this->currentPage = $this->pageRepository->save($pageDataObject);
     $serviceInfo = ['rest' => ['resourcePath' => self::RESOURCE_PATH . '/' . $this->currentPage->getId(), 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_DELETE], 'soap' => ['service' => self::SERVICE_NAME, 'serviceVersion' => self::SERVICE_VERSION, 'operation' => self::SERVICE_NAME . 'DeleteById']];
     $this->_webApiCall($serviceInfo, [PageInterface::PAGE_ID => $this->currentPage->getId()]);
     $this->pageRepository->getById($this->currentPage['id']);
 }
 /**
  * Get canonical product url path
  *
  * @param PageInterface $cmsPage
  * @return string
  * @api
  */
 public function getCanonicalUrlPath(PageInterface $cmsPage)
 {
     return 'cms/page/view/page_id/' . $cmsPage->getId();
 }
Esempio n. 3
0
 /**
  * Add page title to error message
  *
  * @param PageInterface $page
  * @param string $errorText
  * @return string
  */
 protected function getErrorWithPageId(PageInterface $page, $errorText)
 {
     return '[Page ID: ' . $page->getId() . '] ' . $errorText;
 }
Esempio n. 4
0
 /**
  * Add page title to error message
  *
  * @param PageInterface $brand
  * @param string $errorText
  * @return string
  */
 protected function getErrorWithgroupId($brand, $errorText)
 {
     return '[Page ID: ' . $brand->getId() . '] ' . $errorText;
 }