You are here

SimplenewsKernelTest.php in Simplenews 3.x

File

tests/src/Kernel/SimplenewsKernelTest.php
View source
<?php

namespace Drupal\Tests\simplenews\Kernel;

use Drupal\KernelTests\KernelTestBase;

/**
 * Unit tests for certain functions.
 *
 * @group simplenews
 */
class SimplenewsKernelTest extends KernelTestBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = [
    'simplenews',
  ];

  /**
   * Test mail masking function.
   */
  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'));
  }

}

Classes

Namesort descending Description
SimplenewsKernelTest Unit tests for certain functions.