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 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()); }