You are here

public function DoTrustedCallbackTraitTest::providerTestUntrustedCallbacks in Drupal 8

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

Data provider for ::testUntrustedCallbacks().

File

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

Class

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

Namespace

Drupal\Tests\Core\Security

Code

public function providerTestUntrustedCallbacks() {
  $tests['TrustedCallbackInterface_object'] = [
    [
      new TrustedMethods(),
      'unTrustedCallback',
    ],
    TrustedInterface::class,
  ];
  $tests['TrustedCallbackInterface_static_string'] = [
    '\\Drupal\\Tests\\Core\\Security\\TrustedMethods::unTrustedCallback',
    TrustedInterface::class,
  ];
  $tests['TrustedCallbackInterface_static_array'] = [
    [
      TrustedMethods::class,
      'unTrustedCallback',
    ],
    TrustedInterface::class,
  ];
  $tests['untrusted_object'] = [
    [
      new UntrustedObject(),
      'callback',
    ],
    TrustedInterface::class,
  ];
  $tests['untrusted_object_static_string'] = [
    '\\Drupal\\Tests\\Core\\Security\\UntrustedObject::callback',
    TrustedInterface::class,
  ];
  $tests['untrusted_object_static_array'] = [
    [
      UntrustedObject::class,
      'callback',
    ],
    TrustedInterface::class,
  ];
  $tests['invokable_untrusted_object_static_array'] = [
    new InvokableUntrustedObject(),
    TrustedInterface::class,
  ];
  return $tests;
}