function it_shares_the_notifications_from_the_session(Notifier $notifier, Factory $viewFactory, Request $request)
 {
     $notifications = Notifications::mapFromArray([]);
     $notifier->getCurrentNotifications()->willReturn($notifications);
     $viewFactory->share('notifications', $notifications)->shouldBeCalled();
     $next = function ($req) use($request) {
         return $req === $request->getWrappedObject();
     };
     $this->handle($request, $next)->shouldBe(true);
 }
Exemple #2
0
 /**
  * @return Notifications
  */
 public function getCurrentNotifications()
 {
     $notifications = $this->session->get($this->currentKey());
     return Notifications::mapFromArray($notifications);
 }