function DoTrustedCallbackTraitTest::testWarning

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php \Drupal\Tests\Core\Security\DoTrustedCallbackTraitTest::testWarning()
  2. 10 core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php \Drupal\Tests\Core\Security\DoTrustedCallbackTraitTest::testWarning()

@dataProvider errorTypeProvider

File

core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php, line 89

Class

DoTrustedCallbackTraitTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Security%21DoTrustedCallbackTrait.php/trait/DoTrustedCallbackTrait/8.9.x" title="Ensures that TrustedCallbackInterface can be enforced for callback methods." class="local">\Drupal\Core\Security\DoTrustedCallbackTrait</a> @group Security

Namespace

Drupal\Tests\Core\Security

Code

public function testWarning($callback) {
    $this->expectException(Warning::class, 'Drupal\\Tests\\Core\\Security\\UntrustedObject::callback is not trusted');
    $this->doTrustedCallback($callback, [], '%s is not trusted', TrustedCallbackInterface::TRIGGER_WARNING);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.