Files
FOSSBilling/tests-legacy/integration/bb-modules/mod_stats/Api_AdminTest.php
T
Belle Aerni 8f4d0d4cac More tests and CI improvements (#2078)
* Wrote a few more tests, improvements

* Ran Rector & PHP-CS-Fixer

* Append a capital letter to the test client passwords

* Minor tweaks

* Display more info after the tests run

* Oops, I forgot to set the dir

* Fix cron behavior for test env, dropped legacy tests

* Rename the empty test suite so PHPUnit ignores it

* Update cspell.json

* Minor tweaks to the tests

* Fixes
2024-01-17 18:11:45 -08:00

56 lines
1.6 KiB
PHP

<?php
#[PHPUnit\Framework\Attributes\Group('Core')]
class Api_Admin_StatsTest extends BBDbApiTestCase
{
protected $_initialSeedFile = 'orders.xml';
public function testSummary()
{
$array = $this->api_admin->stats_get_summary();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_summary_income();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_orders_statuses();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_income_vs_refunds();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_product_summary();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_product_sales();
$this->assertIsArray($array);
$array = $this->api_admin->stats_client_countries();
$this->assertIsArray($array);
$array = $this->api_admin->stats_sales_countries();
$this->assertIsArray($array);
}
public function testGraphs()
{
$array = $this->api_admin->stats_get_orders();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_clients();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_invoices();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_refunds();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_income();
$this->assertIsArray($array);
$array = $this->api_admin->stats_get_tickets();
$this->assertIsArray($array);
}
}