api = new Admin(); } public function testGetDi(): void { $di = $this->getDi(); $this->api->setDi($di); $getDi = $this->api->getDi(); $this->assertEquals($di, $getDi); } public function testGetSummary(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getSummary') ->willReturn([]); $this->api->setService($serviceMock); $result = $this->api->get_summary(); $this->assertIsArray($result); } public function testGetSummaryIncome(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getSummaryIncome') ->willReturn([]); $this->api->setService($serviceMock); $result = $this->api->get_summary_income(); $this->assertIsArray($result); } public function testGetOrdersStatuses(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getOrdersStatuses') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_orders_statuses($data); $this->assertIsArray($result); } public function testGetProductSummary(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getProductSummary') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_product_summary($data); $this->assertIsArray($result); } public function testGetProductSales(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getProductSales') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_product_sales($data); $this->assertIsArray($result); } public function testGetIncomeVsRefunds(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('incomeAndRefundStats') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_income_vs_refunds($data); $this->assertIsArray($result); } public function testGetRefunds(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getRefunds') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_refunds($data); $this->assertIsArray($result); } public function testGetIncome(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getIncome') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_income($data); $this->assertIsArray($result); } public function testGetOrders(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getTableStats') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_orders($data); $this->assertIsArray($result); } public function testGetClients(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getTableStats') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_clients($data); $this->assertIsArray($result); } public function testClientCountries(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getClientCountries') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->client_countries($data); $this->assertIsArray($result); } public function testSalesCountries(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getSalesByCountry') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->sales_countries($data); $this->assertIsArray($result); } public function testGetInvoices(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getTableStats') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_invoices($data); $this->assertIsArray($result); } public function testGetTickets(): void { $serviceMock = $this->createMock(\Box\Mod\Stats\Service::class); $serviceMock->expects($this->atLeastOnce()) ->method('getTableStats') ->willReturn([]); $this->api->setService($serviceMock); $data = []; $result = $this->api->get_tickets($data); $this->assertIsArray($result); } }