/**
     * @test
     */
    public function getAllOrders()
    {
        $sql = <<<EOS
SELECT o.* 
FROM `order` o
EOS;
        $order = new Order(1);
        $order->setStatus('placed');
        $orders = [['id' => 1, 'status' => 'placed']];
        $this->db->expects(self::once())->method('fetchAll')->with($sql)->willReturn($orders);
        $result = $this->repository->getAll();
        self::assertEquals($order, $result[0]);
    }
Пример #2
0
 /**
  * GET /order
  *
  * @return \Symfony\Component\HttpFoundation\JsonResponse
  */
 public function getList()
 {
     return new JsonResponse($this->orderRepository->getAll());
 }