/**
  * {@inheritdoc}
  */
 public function getType()
 {
     if ($this->getMessageElement()->hasClass('positive')) {
         return NotificationType::success();
     }
     if ($this->getMessageElement()->hasClass('negative')) {
         return NotificationType::failure();
     }
     throw new \RuntimeException('Cannot resolve notification type');
 }
Beispiel #2
0
 /**
  * @Then I should be notified that my password has been successfully changed
  */
 public function iShouldBeNotifiedThatMyPasswordHasBeenSuccessfullyChanged()
 {
     $this->notificationChecker->checkNotification('has been changed successfully!', NotificationType::success());
 }
Beispiel #3
0
 /**
  * @Then I should be notified that the address has been set as default
  */
 public function iShouldBeNotifiedThatAddressHasBeenSetAsDefault()
 {
     $this->notificationChecker->checkNotification('Address has been set as default', NotificationType::success());
 }
 /**
  * @Then I should be notified that it has been successfully deleted
  */
 public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted()
 {
     $this->notificationChecker->checkNotification('has been successfully deleted.', NotificationType::success());
 }
 /**
  * @Then I should be notified that this zone cannot be deleted
  */
 public function iShouldBeNotifiedThatThisZoneCannotBeDeleted()
 {
     $this->notificationChecker->checkNotification('Error Cannot delete, the zone is in use.', NotificationType::failure());
 }
 /**
  * @Then /^I should be notified that it has been successfully (accepted|rejected)$/
  */
 public function iShouldBeNotifiedThatItHasBeenSuccessfullyUpdated($action)
 {
     $this->notificationChecker->checkNotification(sprintf('Product review has been successfully %s.', $action), NotificationType::success());
 }
 function it_throws_notification_mismatch_exception_if_success_message_type_has_been_found_but_expect_failure(NotificationAccessorInterface $notificationAccessor)
 {
     $notificationAccessor->getType()->willReturn(NotificationType::success());
     $notificationAccessor->getMessage()->willReturn('Something went wrong.');
     $this->shouldThrow(new NotificationExpectationMismatchException(NotificationType::failure(), 'Something went wrong.', NotificationType::success(), 'Something went wrong.'))->during('checkNotification', ['Something went wrong.', NotificationType::failure()]);
 }
 /**
  * @Then I should be notified that it is in use and cannot be deleted
  */
 public function iShouldBeNotifiedOfFailure()
 {
     $this->notificationChecker->checkNotification("Cannot delete, the promotion is in use.", NotificationType::failure());
 }
 /**
  * @Then I should be notified that it cannot be deleted
  */
 public function iShouldBeNotifiedThatItCannotBeDeleted()
 {
     $this->notificationChecker->checkNotification("The channel cannot be deleted. At least one enabled channel is required.", NotificationType::failure());
 }
 /**
  * @Then I should be notified that it is in use
  */
 public function iShouldBeNotifiedThatItIsInUse()
 {
     $this->notificationChecker->checkNotification('Cannot delete, the shipping method is in use.', NotificationType::failure());
 }
Beispiel #11
0
 /**
  * @Then I should be notified that the verification email has been sent
  */
 public function iShouldBeNotifiedThatTheVerificationEmailHasBeenSent()
 {
     $this->notificationChecker->checkNotification('An email with the verification link has been sent to your email address.', NotificationType::success());
 }
Beispiel #12
0
 /**
  * @Then I should be notified that promotion coupon is not valid
  */
 public function iShouldBeNotifiedThatPromotionCouponIsNotValid()
 {
     $this->notificationChecker->checkNotification('Your promotion coupon is not valid.', NotificationType::failure());
 }
 /**
  * @Then I should be notified that it has been successfully generated
  */
 public function iShouldBeNotifiedThatItHasBeenSuccessfullyGenerated()
 {
     $this->notificationChecker->checkNotification('Success Product variants have been successfully generated.', NotificationType::success());
 }
Beispiel #14
0
 /**
  * @Then I should be notified that my review is waiting for the acceptation
  */
 public function iShouldBeNotifiedThatMyReviewIsWaitingForTheAcceptation()
 {
     $this->notificationChecker->checkNotification('Your review is waiting for the acceptation.', NotificationType::success());
 }
Beispiel #15
0
 /**
  * @Then I should be notified that email with reset instruction has been send
  */
 public function iShouldBeNotifiedThatEmailWithResetInstructionWasSend()
 {
     $this->notificationChecker->checkNotification('If the email you have specified exists in our system, we have sent there an instruction on how to reset your password.', NotificationType::success());
 }
 /**
  * @Then I should be notified that it cannot be deleted
  */
 public function iShouldBeNotifiedThatItCannotBeDeleted()
 {
     $this->notificationChecker->checkNotification('Cannot remove currently logged in user.', NotificationType::failure());
 }
Beispiel #17
0
 /**
  * @Then I should be notified that the product has been successfully added
  */
 public function iShouldBeNotifiedThatItHasBeenSuccessfullyAdded()
 {
     $this->notificationChecker->checkNotification('Item has been added to cart', NotificationType::success());
 }
Beispiel #18
0
 /**
  * @Then I should be notified that it has been successfully updated
  */
 public function iShouldBeNotifiedAboutItHasBeenSuccessfullyCanceled()
 {
     $this->notificationChecker->checkNotification('Order has been successfully updated.', NotificationType::success());
 }
Beispiel #19
0
 /**
  * @Then I should be notified that new account has been successfully created
  */
 public function iShouldBeNotifiedThatNewAccountHasBeenSuccessfullyCreated()
 {
     $this->notificationChecker->checkNotification('Customer has been successfully created.', NotificationType::success());
 }