function it_should_have_a_default_success_flash_message_for_event_name($session, $translator, FlashEvent $event, FlashBag $flashBag)
 {
     $messages = [SyliusCartEvents::ITEM_ADD_COMPLETED => 'The cart has been successfully updated.'];
     $event->getMessage()->willReturn(null);
     $event->getName()->willReturn(SyliusCartEvents::ITEM_ADD_COMPLETED);
     $session->getBag(Argument::exact('flashes'))->willReturn($flashBag);
     $translator->trans(Argument::cetera())->willReturn($messages[SyliusCartEvents::ITEM_ADD_COMPLETED]);
     $flashBag->add('success', $messages[SyliusCartEvents::ITEM_ADD_COMPLETED])->willReturn(null);
     $this->addSuccessFlash($event);
 }
Exemple #2
0
 /**
  * @param FlashEvent $event
  */
 public function addSuccessFlash(FlashEvent $event)
 {
     $this->addFlash('success', $event->getMessage(), $event->getName());
 }