function it_obtains_order_and_customer_statistics_from_the_repositories(OrderRepositoryInterface $orderRepository, CustomerRepositoryInterface $customerRepository) { $expectedStats = new DashboardStatistics(450, 2, 6); $orderRepository->getTotalSales()->willReturn(450); $orderRepository->count()->willReturn(2); $customerRepository->count()->willReturn(6); $this->getStatistics()->shouldBeLike($expectedStats); }
/** * {@inheritdoc} */ public function getStatistics() { return new DashboardStatistics($this->orderRepository->getTotalSales(), $this->orderRepository->count(), $this->customerRepository->count()); }