コード例 #1
0
ファイル: UserContext.php プロジェクト: vikey89/Sylius
 /**
  * @When I delete the account of :email user
  */
 public function iDeleteAccount($email)
 {
     $user = $this->userRepository->findOneByEmail($email);
     $this->sharedStorage->set('deleted_user', $user);
     $this->customerShowPage->open(['id' => $user->getCustomer()->getId()]);
     $this->customerShowPage->deleteAccount();
 }
コード例 #2
0
 function it_ensures_customer_is_not_deleted_again(CustomerShowPage $customerShowPage, SharedStorageInterface $sharedStorage, CustomerInterface $customer)
 {
     $sharedStorage->get('customer')->willReturn($customer);
     $customer->getId()->willReturn(1);
     $customerShowPage->open(['id' => 1])->shouldBeCalled();
     $customerShowPage->deleteAccount()->willThrow(new ElementNotFoundException('Element not found.'));
     $this->iShouldNotBeAbleToDeleteCustomerAgain();
 }
コード例 #3
0
ファイル: UserContextSpec.php プロジェクト: vikey89/Sylius
 function it_does_not_allow_deleting_my_own_account(SharedStorageInterface $sharedStorage, UserInterface $admin, CustomerShowPage $customerShowPage)
 {
     $sharedStorage->get('admin')->willReturn($admin);
     $admin->getId()->willReturn(1);
     $customerShowPage->open(['id' => 1])->shouldBeCalled();
     $this->iTryDeletingMyOwnAccount();
     $customerShowPage->deleteAccount()->willThrow(new ElementNotFoundException('Element not found.'));
     $this->iShouldNotBeAbleToDeleteMyOwnAccount();
 }