Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Unit/UtilsTest.php
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | class UtilsTest extends TestCase | ||||
public function testEmailToLower(): void | public function testEmailToLower(): void | ||||
{ | { | ||||
$this->assertSame('test@test.tld', Utils::emailToLower('test@Test.Tld')); | $this->assertSame('test@test.tld', Utils::emailToLower('test@Test.Tld')); | ||||
$this->assertSame('test@test.tld', Utils::emailToLower('Test@Test.Tld')); | $this->assertSame('test@test.tld', Utils::emailToLower('Test@Test.Tld')); | ||||
$this->assertSame('shared+shared/Test@test.tld', Utils::emailToLower('shared+shared/Test@Test.Tld')); | $this->assertSame('shared+shared/Test@test.tld', Utils::emailToLower('shared+shared/Test@Test.Tld')); | ||||
} | } | ||||
/** | /** | ||||
* Test for Utils::money() | |||||
*/ | |||||
public function testMoney(): void | |||||
{ | |||||
$this->assertSame('-0,01 CHF', Utils::money(-1, 'CHF')); | |||||
$this->assertSame('0,00 CHF', Utils::money(0, 'CHF')); | |||||
$this->assertSame('1,11 €', Utils::money(111, 'EUR')); | |||||
$this->assertSame('1,00 CHF', Utils::money(100, 'CHF')); | |||||
$this->assertSame('€0.00', Utils::money(0, 'EUR', 'en_US')); | |||||
} | |||||
/** | |||||
* Test for Utils::normalizeAddress() | * Test for Utils::normalizeAddress() | ||||
*/ | */ | ||||
public function testNormalizeAddress(): void | public function testNormalizeAddress(): void | ||||
{ | { | ||||
$this->assertSame('', Utils::normalizeAddress('')); | $this->assertSame('', Utils::normalizeAddress('')); | ||||
$this->assertSame('', Utils::normalizeAddress(null)); | $this->assertSame('', Utils::normalizeAddress(null)); | ||||
$this->assertSame('test', Utils::normalizeAddress('TEST')); | $this->assertSame('test', Utils::normalizeAddress('TEST')); | ||||
$this->assertSame('test@domain.tld', Utils::normalizeAddress('Test@Domain.TLD')); | $this->assertSame('test@domain.tld', Utils::normalizeAddress('Test@Domain.TLD')); | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |