Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCustomerBackendDuplicateErrorMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Customer\Test\Page\Adminhtml\CustomerIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertCustomerBackendDuplicateErrorMessage extends AbstractConstraint
16 {
20  const ERROR_SAVE_MESSAGE = 'A customer with the same email address already exists in an associated website.';
21 
28  public function processAssert(CustomerIndex $customerIndexPage)
29  {
30  $actualMessage = $customerIndexPage->getMessagesBlock()->getErrorMessage();
31  \PHPUnit\Framework\Assert::assertEquals(
32  self::ERROR_SAVE_MESSAGE,
33  $actualMessage,
34  'Wrong error message is displayed.'
35  . "\nExpected: " . self::ERROR_SAVE_MESSAGE
36  . "\nActual: " . $actualMessage
37  );
38  }
39 
45  public function toString()
46  {
47  return 'Assert that error duplicated message is displayed.';
48  }
49 }