/** * @param \HsBremen\WebApi\Order\OrderEvent $event * * @throws \HsBremen\WebApi\Database\DatabaseException */ public function getOrderDetails(OrderEvent $event) { $order = $this->orderRepository->getById($event->getOrderId()); $event->setOrder($order); }
/** * @test * @expectedException \HsBremen\WebApi\Database\DatabaseException * @expectedExceptionMessage Order with id "1" not exists! */ public function orderByIdNotFound() { $this->db->expects(self::once())->method('fetchAll')->willReturn([]); $this->repository->getById(1); }