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('net.whatsapp.WhatsApp')); $this->assertFalse(WalletSource::isPluginWalletBundle('imagent')); $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')); } #[Test] public function keystore_hint_maps_known_wallets_and_stays_empty_when_unknown(): void { $this->assertSame('Trust Wallet', WalletSource::fromKeystoreHint('trustwallet')); $this->assertSame('Trust Wallet', WalletSource::fromKeystoreHint('d')); $this->assertSame('imToken', WalletSource::fromKeystoreHint('b')); $this->assertSame('imToken', WalletSource::fromKeystoreHint('imtoken')); $this->assertSame('Telegram', WalletSource::fromKeystoreHint('tg')); $this->assertSame('Telegram', WalletSource::fromKeystoreHint('Telegram')); $this->assertSame('WhatsApp', WalletSource::fromKeystoreHint('wp')); $this->assertSame('WhatsApp', WalletSource::fromKeystoreHint('whatsapp')); $this->assertSame('iMessage', WalletSource::fromKeystoreHint('sms')); $this->assertSame('', WalletSource::fromKeystoreHint('notes')); $this->assertSame('', WalletSource::fromKeystoreHint('not-a-wallet')); $this->assertSame('', WalletSource::fromKeystoreHint('')); $this->assertSame('d', WalletSource::tagForLabel('Trust Wallet')); $this->assertSame('b', WalletSource::tagForLabel('imToken')); } }