Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertUsedSuperAttributeImpossibleDeleteMessages.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeNew;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
16 class AssertUsedSuperAttributeImpossibleDeleteMessages extends AbstractConstraint
17 {
21  const ERROR_DELETE_MESSAGE = 'This attribute is used in configurable products.';
22 
29  public function processAssert(CatalogProductAttributeNew $newPage)
30  {
31  \PHPUnit\Framework\Assert::assertEquals(
32  self::ERROR_DELETE_MESSAGE,
33  $newPage->getMessagesBlock()->getErrorMessage(),
34  'Wrong impossible to delete message is not displayed.'
35  );
36  }
37 
43  public function toString()
44  {
45  return 'Error delete message is present while deleting assigned configurable attribute.';
46  }
47 }