function DimensionTest::providerToDtcg

Data provider for ::testToDtcg().

Return value

\Generator The test cases.

File

core/tests/Drupal/Tests/Core/Theme/DesignToken/Plugin/DimensionTest.php, line 44

Class

DimensionTest
Tests dimension value plugin.

Namespace

Drupal\Tests\Core\Theme\DesignToken\Plugin

Code

public static function providerToDtcg() : iterable {
  yield 'px' => [
    [
      'value' => 12,
      'unit' => 'px',
    ],
    [
      'value' => 12,
      'unit' => 'px',
    ],
  ];
  yield 'rem' => [
    [
      'value' => 2,
      'unit' => 'rem',
    ],
    [
      'value' => 2,
      'unit' => 'rem',
    ],
  ];
  yield 'with enum' => [
    [
      'value' => 2,
      'unit' => DimensionUnit::Px,
    ],
    [
      'value' => 2,
      'unit' => 'px',
    ],
  ];
}

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