public function testHandle()
 {
     $cartCalculator = $this->dummyData->getCartCalculator();
     $cartService = $this->mockService->getCartService();
     $dtoBuilderFactory = $this->getDTOBuilderFactory();
     $request = new GetCartBySessionIdRequest(self::UUID_HEX);
     $response = new GetCartBySessionIdResponse($cartCalculator);
     $handler = new GetCartBySessionIdHandler($cartService, $dtoBuilderFactory);
     $handler->handle(new GetCartBySessionIdQuery($request, $response));
     $this->assertTrue($response->getCartDTO() instanceof CartDTO);
 }
예제 #2
0
 /**
  * @return CartDTO
  * @throws EntityNotFoundException
  */
 private function getCartFromSession()
 {
     $request = new GetCartBySessionIdRequest($this->getSessionId());
     $response = new GetCartBySessionIdResponse($this->getCartCalculator());
     $this->dispatchQuery(new GetCartBySessionIdQuery($request, $response));
     return $response->getCartDTO();
 }