You are here

public function MailTest::providerTestDisplayName in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Utility/MailTest.php \Drupal\Tests\Component\Utility\MailTest::providerTestDisplayName()

Data provider for testFormatDisplayName().

Return value

array An array containing a string and its 'display-name' safe value.

See also

testFormatDisplayName()

File

core/tests/Drupal/Tests/Component/Utility/MailTest.php, line 39

Class

MailTest
Test mail helpers implemented in Mail component.

Namespace

Drupal\Tests\Component\Utility

Code

public function providerTestDisplayName() {
  return [
    // Simple ASCII characters.
    [
      'Test site',
      'Test site',
    ],
    // ASCII with html entity.
    [
      'Test & site',
      'Test & site',
    ],
    // Non-ASCII characters.
    [
      'Tést site',
      '=?UTF-8?B?VMOpc3Qgc2l0ZQ==?=',
    ],
    // Non-ASCII with special characters.
    [
      'Tést; site',
      '=?UTF-8?B?VMOpc3Q7IHNpdGU=?=',
    ],
    // Non-ASCII with html entity.
    [
      'Tést; site',
      '=?UTF-8?B?VMOpc3Q7IHNpdGU=?=',
    ],
    // ASCII with special characters.
    [
      'Test; site',
      '"Test; site"',
    ],
    // ASCII with special characters as html entity.
    [
      'Test < site',
      '"Test < site"',
    ],
    // ASCII with special characters and '\'.
    [
      'Test; \\ "site"',
      '"Test; \\\\ \\"site\\""',
    ],
    // String already RFC-2822 compliant.
    [
      '"Test; site"',
      '"Test; site"',
    ],
    // String already RFC-2822 compliant.
    [
      '"Test; \\\\ \\"site\\""',
      '"Test; \\\\ \\"site\\""',
    ],
  ];
}