function FontWeightTest::testInvalidUnit
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Theme/DesignToken/Plugin/FontWeightTest.php \Drupal\Tests\Core\Theme\DesignToken\Plugin\FontWeightTest::testInvalidUnit()
Tests invalid unit.
File
-
core/
tests/ Drupal/ Tests/ Core/ Theme/ DesignToken/ Plugin/ FontWeightTest.php, line 114
Class
- FontWeightTest
- Tests font weight value plugin.
Namespace
Drupal\Tests\Core\Theme\DesignToken\PluginCode
public function testInvalidUnit() : void {
$this->expectException(\ValueError::class);
$this->expectExceptionMessage('"<script>alert()</script>" is not a valid backing value for enum Drupal\\Core\\Theme\\DesignToken\\Enum\\FontWeightAlias');
$configuration = [
'value' => '<script>alert()</script>',
];
new FontWeight($configuration, $this->pluginId, []);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.