mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-02 05:08:06 +09:00
* 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
47 lines
1.8 KiB
PHP
47 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use APIHelper\Request;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class StatsAdminTest extends TestCase
|
|
{
|
|
public function testStatsSummary(): void
|
|
{
|
|
$result = Request::makeRequest('admin/stats/get_summary');
|
|
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
|
|
$this->assertIsArray($result->getResult());
|
|
}
|
|
|
|
public function testStatsSummaryIncome(): void
|
|
{
|
|
$result = Request::makeRequest('admin/stats/get_summary_income');
|
|
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
|
|
$this->assertIsArray($result->getResult());
|
|
}
|
|
|
|
public function testStatsOrderStatus(): void
|
|
{
|
|
$result = Request::makeRequest('admin/stats/get_orders_statuses');
|
|
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
|
|
$this->assertIsArray($result->getResult());
|
|
}
|
|
|
|
public function testStatsProductSummary(): void
|
|
{
|
|
$result = Request::makeRequest('admin/stats/get_product_summary');
|
|
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
|
|
$this->assertIsArray($result->getResult());
|
|
}
|
|
|
|
/* TODO: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'fossbilling.client_order.title' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
|
|
public function testStatsProductSales(): void
|
|
{
|
|
$result = Request::makeRequest('admin/stats/get_product_sales');
|
|
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
|
|
$this->assertIsArray($result->getResult());
|
|
}
|
|
*/
|
|
}
|