Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductAttributeSuccessDeleteMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
16 class AssertProductAttributeSuccessDeleteMessage extends AbstractConstraint
17 {
18  const SUCCESS_MESSAGE = 'You deleted the product attribute.';
19 
26  public function processAssert(CatalogProductAttributeIndex $attributeIndex)
27  {
28  $actualMessage = $attributeIndex->getMessagesBlock()->getSuccessMessage();
29  \PHPUnit\Framework\Assert::assertEquals(
30  self::SUCCESS_MESSAGE,
31  $actualMessage,
32  'Wrong success message is displayed.'
33  . "\nExpected: " . self::SUCCESS_MESSAGE
34  . "\nActual: " . $actualMessage
35  );
36  }
37 
43  public function toString()
44  {
45  return 'Attribute success delete message is present.';
46  }
47 }