public function index(Request $httpRequest)
 {
     $queryString = $httpRequest->query('q');
     $request = new ListOrdersRequest($queryString, $this->getPaginationDTO(20));
     $response = new ListOrdersResponse();
     $this->dispatchQuery(new ListOrdersQuery($request, $response));
     return $this->renderTemplate('admin/order/index.twig', ['orders' => $response->getOrderWithUserDTOs(), 'pagination' => $response->getPaginationDTO(), 'queryString' => $queryString]);
 }
 public function testHandle()
 {
     $tagService = $this->mockService->getOrderService();
     $dtoBuilderFactory = $this->getDTOBuilderFactory();
     $queryString = 'order';
     $request = new ListOrdersRequest($queryString, new PaginationDTO());
     $response = new ListOrdersResponse();
     $handler = new ListOrdersHandler($tagService, $dtoBuilderFactory);
     $handler->handle(new ListOrdersQuery($request, $response));
     $this->assertTrue($response->getOrderDTOs()[0] instanceof OrderDTO);
     $this->assertTrue($response->getPaginationDTO() instanceof PaginationDTO);
 }