Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertFileExtensionHints.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit;
12 
17 {
23  const EXPECTED_MESSAGE = 'Enter separated extensions, like: png, jpg, gif.';
24 
31  public function processAssert(CatalogProductEdit $productPage)
32  {
34  $productForm = $productPage->getProductForm();
35  $productForm->openSection('customer-options');
37  $options = $productForm->getSection('customer-options');
38  $fileOptionElements = $options->getFileOptionElements();
39  foreach ($fileOptionElements as $fileOptionElement) {
40  \PHPUnit\Framework\Assert::assertEquals(
41  self::EXPECTED_MESSAGE,
42  $fileOptionElement->getText(),
43  'Actual message differ from expected.'
44  );
45  }
46  }
47 
53  public function toString()
54  {
55  return 'Assert correct file extensions hint is showed.';
56  }
57 }