function DoTrustedCallbackTraitTest::testTrustedCallbacksWithDeprecatedArg
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php \Drupal\Tests\Core\Security\DoTrustedCallbackTraitTest::testTrustedCallbacksWithDeprecatedArg()
Tests trusted callback argument deprecation.
@legacy-covers ::doTrustedCallback
Attributes
#[DataProvider('providerTestTrustedCallbacks')]
#[IgnoreDeprecations]
File
-
core/
tests/ Drupal/ Tests/ Core/ Security/ DoTrustedCallbackTraitTest.php, line 42
Class
Namespace
Drupal\Tests\Core\SecurityCode
public function testTrustedCallbacksWithDeprecatedArg(callable $callback, $extra_trusted_interface = NULL) : void {
$this->expectUserDeprecationMessage('Calling Drupal\\Core\\Security\\StaticTrustedCallbackHelper::callback() with 5 arguments is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. See https://www.drupal.org/node/3627046');
$return = $this->doTrustedCallback($callback, [], '%s is not trusted', 'exception', $extra_trusted_interface);
$this->assertSame('test', $return);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.