function DoTrustedCallbackTraitTest::testTrustedCallbacks

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php \Drupal\Tests\Core\Security\DoTrustedCallbackTraitTest::testTrustedCallbacks()
  2. 8.9.x core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php \Drupal\Tests\Core\Security\DoTrustedCallbackTraitTest::testTrustedCallbacks()
  3. 10 core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php \Drupal\Tests\Core\Security\DoTrustedCallbackTraitTest::testTrustedCallbacks()

@covers ::doTrustedCallback @dataProvider providerTestTrustedCallbacks

File

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

Class

DoTrustedCallbackTraitTest
@coversDefaultClass \Drupal\Core\Security\DoTrustedCallbackTrait @group Security

Namespace

Drupal\Tests\Core\Security

Code

public function testTrustedCallbacks(callable $callback, $extra_trusted_interface = NULL) : void {
    $return = $this->doTrustedCallback($callback, [], '%s is not trusted', TrustedCallbackInterface::THROW_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.