2021-12-21 10:27:51 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
2022-06-08 06:25:44 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2021-12-21 10:27:51 +01:00
|
|
|
*/
|
2022-06-21 11:57:17 +02:00
|
|
|
|
2021-12-21 10:27:51 +01:00
|
|
|
namespace Tests\Unit;
|
|
|
|
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
class ZeroDecimalTest extends TestCase
|
|
|
|
{
|
2022-06-21 11:57:17 +02:00
|
|
|
public array $currencies = ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'];
|
2021-12-21 10:27:51 +01:00
|
|
|
|
2022-06-21 12:00:57 +02:00
|
|
|
protected function setUp() :void
|
2021-12-21 10:27:51 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testCurrencyHit()
|
|
|
|
{
|
2022-06-21 11:57:17 +02:00
|
|
|
$this->assertTrue(in_array('KRW', $this->currencies));
|
2021-12-21 10:27:51 +01:00
|
|
|
}
|
|
|
|
|
2021-12-21 10:30:44 +01:00
|
|
|
public function testCurrencyMiss()
|
|
|
|
{
|
2022-06-21 11:57:17 +02:00
|
|
|
$this->assertFalse(in_array('USD', $this->currencies));
|
2021-12-21 10:30:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testCurrencyNotexist()
|
|
|
|
{
|
2022-06-21 11:57:17 +02:00
|
|
|
$this->assertFalse(in_array('USDddd', $this->currencies));
|
2021-12-21 10:30:44 +01:00
|
|
|
}
|
2021-12-21 10:27:51 +01:00
|
|
|
}
|