class DesignTokenValuePluginBaseTest
Tests design token value base methods.
Attributes
#[CoversClass(DesignTokenValuePluginBase::class)]
#[Group('design_token')]
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\DrupalTestCaseTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait, \Drupal\Tests\RandomGeneratorTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\Core\Theme\DesignToken\DesignTokenValuePluginBaseTest extends \Drupal\Tests\UnitTestCase
Expanded class hierarchy of DesignTokenValuePluginBaseTest
File
-
core/
tests/ Drupal/ Tests/ Core/ Theme/ DesignToken/ DesignTokenValuePluginBaseTest.php, line 16
Namespace
Drupal\Tests\Core\Theme\DesignTokenView source
class DesignTokenValuePluginBaseTest extends UnitTestCase {
/**
* Tests prepareConfiguration.
*/
public function testPrepareConfiguration(mixed $configuration, array $expected) : void {
$this->assertEquals($expected, DesignTokenValuePluginBase::prepareConfiguration($configuration));
}
/**
* Data provider for ::testPrepareConfiguration().
*
* @return \Generator
* The test cases.
*/
public static function providerPrepareConfiguration() : iterable {
yield 'String' => [
'my value',
[
'value' => 'my value',
],
];
yield 'Array: list' => [
[
'my value',
'my value 2',
],
[
'value' => [
'my value',
'my value 2',
],
],
];
yield 'Array: associative' => [
[
'unit' => 'rem',
],
[
'unit' => 'rem',
],
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.