function DoTrustedCallbackTraitTest::providerTestUntrustedCallbacks

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php \Drupal\Tests\Core\Security\DoTrustedCallbackTraitTest::providerTestUntrustedCallbacks()
  2. 8.9.x core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php \Drupal\Tests\Core\Security\DoTrustedCallbackTraitTest::providerTestUntrustedCallbacks()
  3. 11.x 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 61

Class

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

Namespace

Drupal\Tests\Core\Security

Code

public static 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;
}

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