Files
FOSSBilling BotandFOSSBilling Bot 2b02c0c1a2 Apply PHP Code Styling & Quality Changes (#2323)
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
2024-07-02 20:00:28 +01:00

37 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace CurrencyTests;
use APIHelper\Request;
use PHPUnit\Framework\TestCase;
final class AdminTest extends TestCase
{
public function testGetAvailableCurrencies(): void
{
$result = Request::makeRequest('admin/currency/get_pairs');
$this->assertTrue($result->wasSuccessful());
$list = $result->getResult();
// These for sure should exist
$this->assertArrayHasKey('USD', $list);
$this->assertArrayHasKey('EUR', $list);
$this->assertArrayHasKey('GBP', $list);
$this->assertArrayHasKey('JPY', $list);
$this->assertArrayHasKey('CHF', $list);
$this->assertArrayHasKey('AUD', $list);
$this->assertArrayHasKey('CAD', $list);
$this->assertArrayHasKey('NZD', $list);
$this->assertArrayHasKey('INR', $list);
$this->assertArrayHasKey('HKD', $list);
// These should not exist
$this->assertArrayNotHasKey('XXX', $list);
$this->assertArrayNotHasKey('XTS', $list);
$this->assertArrayNotHasKey('VES', $list);
$this->assertArrayNotHasKey('BZR', $list);
}
}