function DatabaseBackendFactoryTest::getProvider

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php \Drupal\Tests\Core\Cache\DatabaseBackendFactoryTest::getProvider()
  2. 8.9.x core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php \Drupal\Tests\Core\Cache\DatabaseBackendFactoryTest::getProvider()
  3. 11.x core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php \Drupal\Tests\Core\Cache\DatabaseBackendFactoryTest::getProvider()

File

core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php, line 40

Class

DatabaseBackendFactoryTest
@coversDefaultClass \Drupal\Core\Cache\DatabaseBackendFactory @group Cache

Namespace

Drupal\Tests\Core\Cache

Code

public static function getProvider() {
    return [
        'default' => [
            [],
            DatabaseBackend::DEFAULT_MAX_ROWS,
            DatabaseBackend::DEFAULT_MAX_ROWS,
        ],
        'default overridden' => [
            [
                'database_cache_max_rows' => [
                    'default' => 99,
                ],
            ],
            99,
            99,
        ],
        'default + foo bin overridden' => [
            [
                'database_cache_max_rows' => [
                    'bins' => [
                        'foo' => 13,
                    ],
                ],
            ],
            13,
            DatabaseBackend::DEFAULT_MAX_ROWS,
        ],
        'default + bar bin overridden' => [
            [
                'database_cache_max_rows' => [
                    'bins' => [
                        'bar' => 13,
                    ],
                ],
            ],
            DatabaseBackend::DEFAULT_MAX_ROWS,
            13,
        ],
        'default overridden + bar bin overridden' => [
            [
                'database_cache_max_rows' => [
                    'default' => 99,
                    'bins' => [
                        'bar' => 13,
                    ],
                ],
            ],
            99,
            13,
        ],
        'default + both bins overridden' => [
            [
                'database_cache_max_rows' => [
                    'bins' => [
                        'foo' => 13,
                        'bar' => 31,
                    ],
                ],
            ],
            13,
            31,
        ],
        'default overridden + both bins overridden' => [
            [
                'database_cache_max_rows' => [
                    'default' => 99,
                    'bins' => [
                        'foo' => 13,
                        'bar' => 31,
                    ],
                ],
            ],
            13,
            31,
        ],
    ];
}

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