mirror of
https://github.com/ivuorinen/monolog-gdpr-filter.git
synced 2026-02-11 13:49:26 +00:00
feat: initial commit
This commit is contained in:
36
tests/FieldMaskConfigTest.php
Normal file
36
tests/FieldMaskConfigTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\CoversMethod;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Ivuorinen\MonologGdprFilter\FieldMaskConfig;
|
||||
|
||||
#[CoversClass(className: FieldMaskConfig::class)]
|
||||
#[CoversMethod(className: FieldMaskConfig::class, methodName: '__construct')]
|
||||
class FieldMaskConfigTest extends TestCase
|
||||
{
|
||||
public function testMaskRegexConfig(): void
|
||||
{
|
||||
$config = new FieldMaskConfig(FieldMaskConfig::MASK_REGEX);
|
||||
$this->assertSame(FieldMaskConfig::MASK_REGEX, $config->type);
|
||||
$this->assertNull($config->replacement);
|
||||
}
|
||||
|
||||
public function testRemoveConfig(): void
|
||||
{
|
||||
$config = new FieldMaskConfig(FieldMaskConfig::REMOVE);
|
||||
$this->assertSame(FieldMaskConfig::REMOVE, $config->type);
|
||||
$this->assertNull($config->replacement);
|
||||
}
|
||||
|
||||
public function testReplaceConfig(): void
|
||||
{
|
||||
$config = new FieldMaskConfig(FieldMaskConfig::REPLACE, 'MASKED');
|
||||
$this->assertSame(FieldMaskConfig::REPLACE, $config->type);
|
||||
$this->assertSame('MASKED', $config->replacement);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user