Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductAttributeSaveMessage.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 
15 class AssertProductAttributeSaveMessage extends AbstractConstraint
16 {
20  const SUCCESS_MESSAGE = 'You saved the product attribute.';
21 
28  public function processAssert(CatalogProductAttributeIndex $attributeIndex)
29  {
30  $actualMessage = $attributeIndex->getMessagesBlock()->getSuccessMessage();
31  \PHPUnit\Framework\Assert::assertEquals(
32  self::SUCCESS_MESSAGE,
33  $actualMessage,
34  'Wrong success message is displayed.'
35  . "\nExpected: " . self::SUCCESS_MESSAGE
36  . "\nActual: " . $actualMessage
37  );
38  }
39 
45  public function toString()
46  {
47  return 'Attribute success save message is present.';
48  }
49 }