/** * {@inheritdoc} */ public function getUser() { if (null === $this->customer) { return null; } return $this->customer->getUser(); }
/** * @Then /^(this customer) should have "([^"]+)" as their group$/ */ public function thisCustomerShouldHaveAsTheirGroup(CustomerInterface $customer, $groupName) { $this->updatePage->open(['id' => $customer->getId()]); Assert::same($groupName, $this->updatePage->getGroupName(), sprintf('Customer should have %s as group, but it does not', $groupName)); }
/** * @When I view details of the customer :customer */ public function iViewDetailsOfTheCustomer(CustomerInterface $customer) { $this->showPage->open(['id' => $customer->getId()]); }
/** * @When I change the password of user :customer to :newPassword */ public function iChangeThePasswordOfUserTo(CustomerInterface $customer, $newPassword) { $this->updatePage->open(['id' => $customer->getId()]); $this->updatePage->changePassword($newPassword); $this->updatePage->saveChanges(); }
/** * @Given I am impersonating the customer :customer */ public function iAmImpersonatingCustomer(CustomerInterface $customer) { $this->customerShowPage->open(['id' => $customer->getId()]); $this->customerShowPage->impersonate(); $this->homePage->open(); }