function it_checks_if_customer_still_exists(ShowPageInterface $customerShowPage, SharedStorageInterface $sharedStorage, CustomerInterface $customer, UserInterface $user) { $sharedStorage->get('deleted_user')->shouldBeCalled()->willReturn($user); $user->getCustomer()->willReturn($customer); $customer->getId()->willReturn(1); $customerShowPage->open(['id' => 1])->shouldBeCalled(); $customerShowPage->isRegistered()->willReturn(false); $this->customerShouldStillExist(); }
function it_checks_if_account_was_deleted(SharedStorageInterface $sharedStorage, UserInterface $user, CustomerInterface $customer, ShowPageInterface $customerShowPage) { $sharedStorage->get('deleted_user')->willReturn($user); $user->getCustomer()->willReturn($customer); $customer->getId()->willReturn(1); $customerShowPage->open(['id' => 1])->shouldBeCalled(); $customerShowPage->isRegistered()->willReturn(false); $this->accountShouldBeDeleted(); }
/** * @Then the user account should be deleted */ public function accountShouldBeDeleted() { $deletedUser = $this->sharedStorage->get('deleted_user'); $this->customerShowPage->open(['id' => $deletedUser->getCustomer()->getId()]); expect($this->customerShowPage->isRegistered())->toBe(false); }
/** * @Then I should see that this customer has verified the email */ public function iShouldSeeThatThisCustomerHasVerifiedTheEmail() { Assert::true($this->showPage->hasVerifiedEmail(), 'There should be information that this customer has verified the email.'); }
/** * @Then the province in the billing address should be :provinceName */ public function theProvinceInTheShippingBillingShouldBe($provinceName) { Assert::true($this->showPage->hasBillingProvinceName($provinceName), sprintf('Cannot find shipping address with province %s', $provinceName)); }
/** * @Then I should see that this customer is subscribed to the newsletter */ public function iShouldSeeThatThisCustomerIsSubscribedToTheNewsletter() { Assert::true($this->showPage->isSubscribedToNewsletter(), 'There should be information that this customer is subscribed to the newsletter.'); }
/** * @Then the customer with this email should still exist */ public function customerShouldStillExist() { $deletedUser = $this->sharedStorage->get('deleted_user'); $this->customerShowPage->open(['id' => $deletedUser->getCustomer()->getId()]); Assert::false($this->customerShowPage->isRegistered()); }
/** * @Then I should see information about no existing account for this customer */ public function iShouldSeeInformationAboutNoExistingAccountForThisCustomer() { Assert::true($this->showPage->hasAccount(), 'There should be information about no account, but there is none.'); }
/** * @Then his billing address should be :billingAddress */ public function hisBillingAddressShouldBe($billingAddress) { Assert::same(str_replace(',', '', $billingAddress), $this->showPage->getBillingAddress(), 'Customer billing address should be "' . $billingAddress . '", but it is not.'); }
/** * @Then I should see that impersonating :email was successful */ public function iShouldSeeThatImpersonatingWasSuccessful($email) { Assert::contains($this->customerShowPage->getSuccessFlashMessage(), $email); }