function MachineNameTest::testMachineNameOrderException
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/Render/Element/MachineNameTest.php \Drupal\KernelTests\Core\Render\Element\MachineNameTest::testMachineNameOrderException()
- 10 core/tests/Drupal/KernelTests/Core/Render/Element/MachineNameTest.php \Drupal\KernelTests\Core\Render\Element\MachineNameTest::testMachineNameOrderException()
Tests the order of the machine name field and the source.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Render/ Element/ MachineNameTest.php, line 69
Class
- MachineNameTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21MachineName.php/class/MachineName/11.x" title="Provides a machine name render element." class="local">\Drupal\Core\Render\Element\MachineName</a> @group Render
Namespace
Drupal\KernelTests\Core\Render\ElementCode
public function testMachineNameOrderException() : void {
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('The machine name element "test_machine_name" is defined before the source element "test_source", it must be defined after or the source element must specify an id.');
$form = \Drupal::formBuilder()->getForm($this);
$this->render($form);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.