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