function MenuValidationTest::testDescription
Same name in other branches
- 10 core/modules/system/tests/src/Kernel/Entity/MenuValidationTest.php \Drupal\Tests\system\Kernel\Entity\MenuValidationTest::testDescription()
Tests that description is optional, and limited to 512 characters.
phpcs:disable Drupal.Commenting cspell:disable
@testWith [null, {}] ["", {}] ["This is an ASCII description.", {}] ["This is an emoji in a description: 🕺.", []] ["Iste et sunt ut cum. Suscipit officia molestias amet provident et sunt sit. Tenetur doloribus odit sapiente doloremque sequi id dignissimos. In rerum nihil voluptatibus architecto laborum. Repellendus eligendi laborum id nesciunt alias incidunt non. Tenetur deserunt facere voluptas nisi id. Aut ab eaque eligendi. Nihil quasi illum sit provident voluptatem repellat temporibus autem. Mollitia quisquam error facilis quasi voluptate. Dignissimos quis culpa nobis veritatis ut vel laudantium cumque. Rerum mollitia deleniti possimus placeat rerum. Reiciendis distinctio soluta voluptatem.", {"description": "This value is too long. It should have <em class=\"placeholder\">512</em> characters or less."}]
cspell:enable phpcs:enable Drupal.Commenting
File
-
core/
modules/ system/ tests/ src/ Kernel/ Entity/ MenuValidationTest.php, line 75
Class
- MenuValidationTest
- Tests validation of menu entities.
Namespace
Drupal\Tests\system\Kernel\EntityCode
public function testDescription(?string $description, array $expected_errors) : void {
$this->entity
->set('description', $description);
$this->assertValidationErrors($expected_errors);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.