Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCustomerPasswordChanged.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Customer\Test\Page\CustomerAccountIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 use Magento\Mtf\Fixture\FixtureFactory;
13 
17 class AssertCustomerPasswordChanged extends AbstractConstraint
18 {
19  /* tags */
20  const SEVERITY = 'low';
21  /* end tags */
22 
32  public function processAssert(
33  FixtureFactory $fixtureFactory,
34  CustomerAccountIndex $customerAccountIndex,
35  Customer $initialCustomer,
36  Customer $customer
37  ) {
38  $customer = $fixtureFactory->createByCode(
39  'customer',
40  [
41  'dataset' => 'default',
42  'data' => [
43  'email' => $initialCustomer->getEmail(),
44  'password' => $customer->getPassword(),
45  'password_confirmation' => $customer->getPassword(),
46  ],
47  ]
48  );
49 
50  $this->objectManager->create(
51  \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
52  ['customer' => $customer]
53  )->run();
54 
55  \PHPUnit\Framework\Assert::assertTrue(
56  $customerAccountIndex->getAccountMenuBlock()->isVisible(),
57  'Customer Account Dashboard is not visible.'
58  );
59  }
60 
66  public function toString()
67  {
68  return 'Customer password was changed.';
69  }
70 }
$customer
Definition: customers.php:11
processAssert(FixtureFactory $fixtureFactory, CustomerAccountIndex $customerAccountIndex, Customer $initialCustomer, Customer $customer)