function CacheableMetadataTest::providerSetCacheMaxAge

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php \Drupal\Tests\Core\Cache\CacheableMetadataTest::providerSetCacheMaxAge()
  2. 10 core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php \Drupal\Tests\Core\Cache\CacheableMetadataTest::providerSetCacheMaxAge()
  3. 11.x core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php \Drupal\Tests\Core\Cache\CacheableMetadataTest::providerSetCacheMaxAge()

Data provider for testSetCacheMaxAge.

File

core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php, line 123

Class

CacheableMetadataTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Cache%21CacheableMetadata.php/class/CacheableMetadata/8.9.x" title="Defines a generic class for passing cacheability metadata." class="local">\Drupal\Core\Cache\CacheableMetadata</a> @group Cache

Namespace

Drupal\Tests\Core\Cache

Code

public function providerSetCacheMaxAge() {
    return [
        [
            0,
            FALSE,
        ],
        [
            'http',
            TRUE,
        ],
        [
            '0',
            TRUE,
        ],
        [
            new \stdClass(),
            TRUE,
        ],
        [
            300,
            FALSE,
        ],
        [
            [],
            TRUE,
        ],
        [
            8.0,
            TRUE,
        ],
    ];
}

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