Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCmsPageForm.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex;
11 use Magento\Cms\Test\Page\Adminhtml\CmsPageNew;
13 
18 {
24  protected $skippedFields = [
25  'page_id',
26  'content',
27  'content_heading',
28  'custom_theme_from',
29  'custom_theme_to',
30  ];
31 
40  public function processAssert(
41  CmsPage $cms,
42  CmsPageIndex $cmsIndex,
43  CmsPageNew $cmsPageNew
44  ) {
45  $cmsIndex->open();
46  $filter = ['title' => $cms->getTitle()];
47  $cmsIndex->getCmsPageGridBlock()->searchAndOpen($filter);
48 
49  $cmsFormData = $cmsPageNew->getPageForm()->getData($cms);
50  $cmsFormData['store_id'] = implode('/', $cmsFormData['store_id']);
51  $cmsFixtureData = $cms->getData();
52  $storeId = explode('/', $cms->getStoreId());
53  $cmsFixtureData['store_id'] = array_pop($storeId);
54  $errors = $this->verifyData($cmsFixtureData, $cmsFormData);
55  \PHPUnit\Framework\Assert::assertEmpty($errors, $errors);
56  }
57 
63  public function toString()
64  {
65  return 'CMS page data on edit page equals data from fixture.';
66  }
67 }
processAssert(CmsPage $cms, CmsPageIndex $cmsIndex, CmsPageNew $cmsPageNew)
verifyData(array $fixtureData, array $formData, $isStrict=false, $isPrepareError=true)
$errors
Definition: overview.phtml:9