You are here

public function SimplenewsKernelTest::testMasking in Simplenews 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/SimplenewsKernelTest.php \Drupal\Tests\simplenews\Kernel\SimplenewsKernelTest::testMasking()
  2. 3.x tests/src/Kernel/SimplenewsKernelTest.php \Drupal\Tests\simplenews\Kernel\SimplenewsKernelTest::testMasking()

Test mail masking function.

File

tests/src/Kernel/SimplenewsKernelTest.php, line 24

Class

SimplenewsKernelTest
Unit tests for certain functions.

Namespace

Drupal\Tests\simplenews\Kernel

Code

public function testMasking() {
  $this
    ->assertEqual('t*****@e*****.org', simplenews_mask_mail('test@example.org'));
  $this
    ->assertEqual('t*****@e*****.org', simplenews_mask_mail('t@example.org'));
  $this
    ->assertEqual('t*****@t*****.org', simplenews_mask_mail('t@test.example.org'));
  $this
    ->assertEqual('t*****@e*****', simplenews_mask_mail('t@example'));
}