You are here

public function MimeMailFormatHelperTest::providerTestUrl in Mime Mail 8

Provides test data for testUrl().

File

tests/src/Kernel/MimeMailFormatHelperTest.php, line 290

Class

MimeMailFormatHelperTest
Tests that Mime Mail utility functions work properly.

Namespace

Drupal\Tests\mimemail\Kernel

Code

public function providerTestUrl() {

  // Format of each element is:
  // - url: URL to test.
  // - absolute: Whether the URL is absolute.
  // - expected: URL after formatting.
  return [
    'Hash mark URL without fragment left intact.' => [
      '#',
      FALSE,
      '#',
    ],
    'Security token removed from styled image URL.' => [
      '/sites/default/files/styles/thumbnail/public/image.jpg?itok=Wrl6Qi9U',
      TRUE,
      '/sites/default/files/styles/thumbnail/public/image.jpg',
    ],
    'Space in the filename of the attachment left intact.' => [
      $expected = 'public://' . $this
        ->randomMachineName() . ' ' . $this
        ->randomMachineName() . '.' . $this
        ->randomMachineName(3),
      TRUE,
      $expected,
    ],
  ];
}