function ViewExecutableTest::providerAttachDisplays

Same name in other branches
  1. 9 core/modules/views/tests/src/Unit/ViewExecutableTest.php \Drupal\Tests\views\Unit\ViewExecutableTest::providerAttachDisplays()
  2. 11.x core/modules/views/tests/src/Unit/ViewExecutableTest.php \Drupal\Tests\views\Unit\ViewExecutableTest::providerAttachDisplays()

Provider for testAttachDisplays().

Return value

array[] An array of arrays containing the display state, a user's access to the display and whether it is expected or not that the display gets attached.

File

core/modules/views/tests/src/Unit/ViewExecutableTest.php, line 532

Class

ViewExecutableTest
@coversDefaultClass \Drupal\views\ViewExecutable @group views

Namespace

Drupal\Tests\views\Unit

Code

public static function providerAttachDisplays() {
    return [
        'enabled-granted' => [
            static::DISPLAY_ENABLED,
            static::ACCESS_GRANTED,
            TRUE,
        ],
        'enabled-revoked' => [
            static::DISPLAY_ENABLED,
            static::ACCESS_REVOKED,
            FALSE,
        ],
        'disabled-granted' => [
            static::DISPLAY_DISABLED,
            static::ACCESS_GRANTED,
            FALSE,
        ],
        'disabled-revoked' => [
            static::DISPLAY_DISABLED,
            static::ACCESS_REVOKED,
            FALSE,
        ],
    ];
}

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