function DesignTokenTest::providerToDtcg

Data provider for ::testToDtcg().

Return value

\Generator The test cases.

File

core/tests/Drupal/Tests/Core/Theme/DesignToken/DesignTokenTest.php, line 143

Class

DesignTokenTest
Tests design token object.

Namespace

Drupal\Tests\Core\Theme\DesignToken

Code

public static function providerToDtcg() : iterable {
  $value = new Number([
    'value' => 5,
  ], 'number', []);
  yield 'With type' => [
    'myType',
    $value,
    NULL,
    [
      '$value' => 5,
      '$type' => 'myType',
    ],
  ];
  yield 'With description' => [
    NULL,
    $value,
    'my description',
    [
      '$type' => NULL,
      '$value' => 5,
      '$description' => 'my description',
    ],
  ];
}

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