feat: add designated shop detail and PII masking updates
Rebase current admin changes on top of origin/main and exclude local artifacts from tracking to reduce push payload. Made-with: Cursor
This commit is contained in:
42
tests/unit/PiiMaskTest.php
Normal file
42
tests/unit/PiiMaskTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use CodeIgniter\Test\CIUnitTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PiiMaskTest extends CIUnitTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
helper('pii_mask');
|
||||
}
|
||||
|
||||
public function testMaskPersonNameEmpty(): void
|
||||
{
|
||||
$this->assertSame('', mask_person_name(null));
|
||||
$this->assertSame('', mask_person_name(''));
|
||||
}
|
||||
|
||||
public function testMaskPersonNameKorean(): void
|
||||
{
|
||||
$this->assertSame('*', mask_person_name('홍'));
|
||||
$this->assertSame('김*', mask_person_name('김철'));
|
||||
$this->assertSame('홍*동', mask_person_name('홍길동'));
|
||||
$this->assertSame('남**수', mask_person_name('남궁민수'));
|
||||
}
|
||||
|
||||
public function testMaskMobilePhone(): void
|
||||
{
|
||||
$this->assertSame('', mask_mobile_phone(null));
|
||||
$this->assertSame('', mask_mobile_phone(''));
|
||||
$this->assertSame('010-****-5678', mask_mobile_phone('010-1234-5678'));
|
||||
$this->assertSame('010-****-5678', mask_mobile_phone('01012345678'));
|
||||
$this->assertSame('010-****-5678', mask_mobile_phone('821012345678'));
|
||||
$this->assertSame('02-****-7890', mask_mobile_phone('0212347890'));
|
||||
$this->assertSame('010-****-2312', mask_mobile_phone('0102312'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user