You are here

public function DatabaseBackendFactoryTest::getProvider in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php \Drupal\Tests\Core\Cache\DatabaseBackendFactoryTest::getProvider()

File

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

Class

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

Namespace

Drupal\Tests\Core\Cache

Code

public 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,
    ],
  ];
}