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); }
/** * @return Notifications */ public function getCurrentNotifications() { $notifications = $this->session->get($this->currentKey()); return Notifications::mapFromArray($notifications); }