/**
  * {@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');
 }
 /**
  * @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('Cannot remove currently logged in user.', NotificationType::failure());
 }
 /**
  * @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());
 }
 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
  */
 public function iShouldBeNotifiedThatItIsInUse()
 {
     $this->notificationChecker->checkNotification('Cannot delete, the shipping method 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());
 }
Beispiel #8
0
 /**
  * @Then I should be notified that the verification token is invalid
  */
 public function iShouldBeNotifiedThatTheVerificationTokenIsInvalid()
 {
     $this->notificationChecker->checkNotification('The verification token is invalid.', NotificationType::failure());
 }
Beispiel #9
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());
 }