function StringFormatterTest::providerAccessLinkToEntity

Data provider.

Return value

\Generator Test scenarios.

File

core/modules/field/tests/src/Unit/Plugin/Field/FieldFormatter/StringFormatterTest.php, line 92

Class

StringFormatterTest
Tests the string field formatter.

Namespace

Drupal\Tests\field\Unit\Plugin\Field\FieldFormatter

Code

public static function providerAccessLinkToEntity() : \Generator {
    (yield 'entity with no URL' => [
        FALSE,
        NULL,
        FALSE,
    ]);
    (yield 'entity with url, with access' => [
        TRUE,
        AccessResultAllowed::class,
        TRUE,
    ]);
    (yield 'entity with url, no access' => [
        TRUE,
        AccessResultForbidden::class,
        FALSE,
    ]);
}

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