Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertImpossibleDeleteYourOwnRole.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\User\Test\Page\Adminhtml\UserRoleEditRole;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertImpossibleDeleteYourOwnRole extends AbstractConstraint
16 {
17  const ERROR_MESSAGE = 'You cannot delete self-assigned roles.';
18 
25  public function processAssert(UserRoleEditRole $rolePage)
26  {
27  $errorMessage = $rolePage->getMessagesBlock()->getErrorMessage();
28  \PHPUnit\Framework\Assert::assertEquals(
29  self::ERROR_MESSAGE,
30  $errorMessage,
31  'Wrong success message is displayed.'
32  . "\nExpected: " . self::ERROR_MESSAGE
33  . "\nActual: " . $errorMessage
34  );
35  }
36 
42  public function toString()
43  {
44  return '"You cannot delete self-assigned roles." message on EditRole page is correct.';
45  }
46 }