/** * @Given I am logged in as an administrator */ public function iAmLoggedInAsAnAdministrator() { $admin = $this->testUserFactory->createDefaultAdmin(); $this->userRepository->add($admin); $this->securityService->logIn($admin->getEmail()); $this->sharedStorage->set('admin', $admin); }
/** * @Given there is user :email identified by :password, with :country as shipping country */ public function thereIsUserWithShippingCountry($email, $password, $country) { $user = $this->userFactory->create($email, $password); $customer = $user->getCustomer(); $customer->setShippingAddress($this->createAddress($customer->getFirstName(), $customer->getLastName(), $country)); $this->sharedStorage->set('user', $user); $this->userRepository->add($user); }
/** * @Given there is an administrator identified by :email */ public function thereIsAnAdministratorIdentifiedBy($email) { $administrator = $this->userFactory->createDefaultAdmin(); $administrator->setEmail($email); $this->sharedStorage->set('administrator', $administrator); $this->userRepository->add($administrator); }