function DatelistElementFormTest::testDatelistElementUntrustedCallbacks
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php \Drupal\KernelTests\Core\Datetime\DatelistElementFormTest::testDatelistElementUntrustedCallbacks()
- 10 core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php \Drupal\KernelTests\Core\Datetime\DatelistElementFormTest::testDatelistElementUntrustedCallbacks()
Tests that exceptions are raised if untrusted callbacks are used.
@group legacy
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Datetime/ DatelistElementFormTest.php, line 124
Class
- DatelistElementFormTest
- Tests Datelist functionality.
Namespace
Drupal\KernelTests\Core\DatetimeCode
public function testDatelistElementUntrustedCallbacks() : void {
$this->expectException(UntrustedCallbackException::class);
$this->expectExceptionMessage(sprintf('Datelist element #date_date_callbacks callbacks must be methods of a class that implements \\Drupal\\Core\\Security\\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/3217966', Variable::callableToString([
$this,
'datelistDateCallback',
])));
$form = \Drupal::formBuilder()->getForm($this, 'datelistDateCallback');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.