function FontFamilyTest::providerToCss

Data provider for ::testToCss().

Return value

\Generator The test cases.

File

core/tests/Drupal/Tests/Core/Theme/DesignToken/Plugin/FontFamilyTest.php, line 74

Class

FontFamilyTest
Tests font family value plugin.

Namespace

Drupal\Tests\Core\Theme\DesignToken\Plugin

Code

public static function providerToCss() : iterable {
  yield 'string' => [
    'Arial',
    'Arial',
  ];
  yield 'list' => [
    [
      'Arial',
      'sans-serif',
    ],
    'Arial, sans-serif',
  ];
  yield 'XSS' => [
    [
      'Arial',
      '<script>alert()</script>',
    ],
    'Arial, &lt;script&gt;alert()&lt;/script&gt;',
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.