function ViewsBlockTest::providerTestCacheableMetadata

Data provider for ::testCacheableMetadata()

File

core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php, line 233

Class

ViewsBlockTest
@coversDefaultClass \Drupal\views\Plugin\block\ViewsBlock @group views

Namespace

Drupal\Tests\views\Unit\Plugin\Block

Code

public static function providerTestCacheableMetadata() : array {
    return [
        'View expires before' => [
            500,
            1000,
            500,
        ],
        'Block expires before' => [
            1000,
            500,
            500,
        ],
        'Only block is permanent' => [
            Cache::PERMANENT,
            500,
            500,
        ],
        'Only view is permanent' => [
            500,
            Cache::PERMANENT,
            500,
        ],
        'Both view and block are permanent' => [
            Cache::PERMANENT,
            Cache::PERMANENT,
            Cache::PERMANENT,
        ],
    ];
}

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