Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 /**
  * @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]);
 }