Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Unit/UtilsTest.php
<?php | <?php | ||||
namespace Tests\Unit; | namespace Tests\Unit; | ||||
use App\Utils; | use App\Utils; | ||||
use Tests\TestCase; | use Tests\TestCase; | ||||
class UtilsTest extends TestCase | class UtilsTest extends TestCase | ||||
{ | { | ||||
/** | /** | ||||
* Test for Utils::emailToLower() | |||||
*/ | |||||
public function testEmailToLower(): void | |||||
{ | |||||
$this->assertSame('test@test.tld', \App\Utils::emailToLower('test@Test.Tld')); | |||||
$this->assertSame('test@test.tld', \App\Utils::emailToLower('Test@Test.Tld')); | |||||
$this->assertSame('shared+shared/Test@test.tld', \App\Utils::emailToLower('shared+shared/Test@Test.Tld')); | |||||
} | |||||
/** | |||||
* Test for Utils::normalizeAddress() | * Test for Utils::normalizeAddress() | ||||
*/ | */ | ||||
public function testNormalizeAddress(): void | public function testNormalizeAddress(): void | ||||
{ | { | ||||
$this->assertSame('', \App\Utils::normalizeAddress('')); | $this->assertSame('', \App\Utils::normalizeAddress('')); | ||||
$this->assertSame('', \App\Utils::normalizeAddress(null)); | $this->assertSame('', \App\Utils::normalizeAddress(null)); | ||||
$this->assertSame('test', \App\Utils::normalizeAddress('TEST')); | $this->assertSame('test', \App\Utils::normalizeAddress('TEST')); | ||||
$this->assertSame('test@domain.tld', \App\Utils::normalizeAddress('Test@Domain.TLD')); | $this->assertSame('test@domain.tld', \App\Utils::normalizeAddress('Test@Domain.TLD')); | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |