function it_renders_dashboard_with_statistics(Request $request, DashboardStatisticsProviderInterface $dashboardStatsProvider, EngineInterface $templatingEngine, Response $response) { $dashboardStats = new DashboardStatistics(1245, 5, 6); $dashboardStatsProvider->getStatistics()->willReturn($dashboardStats); $templatingEngine->renderResponse('SyliusAdminBundle:Dashboard:index.html.twig', ['statistics' => $dashboardStats])->willReturn($response); $this->indexAction($request)->shouldReturn($response); }
/** * @param Request $request * * @return Response */ public function indexAction(Request $request) { $channelCode = $request->query->get('channel'); /** @var ChannelInterface $channel */ $channel = $this->findChannelByCodeOrFindFirst($channelCode); if (null === $channel) { return new RedirectResponse($this->router->generate('sylius_admin_channel_create')); } $statistics = $this->statisticsProvider->getStatisticsForChannel($channel); return $this->templatingEngine->renderResponse('SyliusAdminBundle:Dashboard:index.html.twig', ['statistics' => $statistics, 'channel' => $channel]); }
/** * @param Request $request * * @return Response */ public function indexAction(Request $request) { $stats = $this->statisticsProvider->getStatistics(); return $this->templatingEngine->renderResponse('SyliusAdminBundle:Dashboard:index.html.twig', ['statistics' => $stats]); }