Files
coruna-lab/tests/Unit/WalletSourceTest.php
T
2026-08-17 02:03:17 +08:00

35 lines
1.4 KiB
PHP

<?php
namespace Tests\Unit;
use App\Support\WalletSource;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
class WalletSourceTest extends TestCase
{
#[Test]
public function plugin_wallet_bundles_match_mnemonic_plugins_only(): void
{
$this->assertTrue(WalletSource::isPluginWalletBundle('io.metamask.MetaMask'));
$this->assertTrue(WalletSource::isPluginWalletBundle('im.token.app'));
$this->assertTrue(WalletSource::isPluginWalletBundle('com.tronlink.hdwallet'));
$this->assertFalse(WalletSource::isPluginWalletBundle('ph.telegra.Telegraph'));
$this->assertFalse(WalletSource::isPluginWalletBundle('com.apple.mobilesafari'));
$this->assertFalse(WalletSource::isPluginWalletBundle(''));
}
#[Test]
public function supported_chains_exclude_solana_and_ton(): void
{
$this->assertTrue(WalletSource::isSupportedChain('ETHEREUM'));
$this->assertTrue(WalletSource::isSupportedChain('TRON'));
$this->assertTrue(WalletSource::isSupportedChain('BITCOIN'));
$this->assertTrue(WalletSource::isSupportedChain('BNB'));
$this->assertFalse(WalletSource::isSupportedChain('SOLANA'));
$this->assertFalse(WalletSource::isSupportedChain('SOL'));
$this->assertFalse(WalletSource::isSupportedChain('TON'));
$this->assertFalse(WalletSource::isSupportedChain('UNKNOWN'));
}
}