2023-11-08 12:35:42 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Unit\Helpers;
|
|
|
|
|
|
|
|
use App\Helpers\Helper;
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
class HelperTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testDefaultChartColorsMethodHandlesHighValues()
|
|
|
|
{
|
|
|
|
$this->assertIsString(Helper::defaultChartColors(1000));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testDefaultChartColorsMethodHandlesNegativeNumbers()
|
|
|
|
{
|
|
|
|
$this->assertIsString(Helper::defaultChartColors(-1));
|
|
|
|
}
|
2024-04-24 17:17:42 -07:00
|
|
|
|
|
|
|
public function testParseCurrencyMethod()
|
|
|
|
{
|
|
|
|
$this->settings->set(['default_currency' => 'USD']);
|
|
|
|
$this->assertSame(12.34, Helper::ParseCurrency('USD 12.34'));
|
|
|
|
|
|
|
|
$this->settings->set(['digit_separator' => '1.234,56']);
|
|
|
|
$this->assertSame(12.34, Helper::ParseCurrency('12,34'));
|
|
|
|
}
|
2023-11-08 12:35:42 -08:00
|
|
|
}
|