function FileCacheFactoryTest::configurationDataProvider

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php \Drupal\Tests\Component\FileCache\FileCacheFactoryTest::configurationDataProvider()
  2. 10 core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php \Drupal\Tests\Component\FileCache\FileCacheFactoryTest::configurationDataProvider()
  3. 11.x core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php \Drupal\Tests\Component\FileCache\FileCacheFactoryTest::configurationDataProvider()

Data provider for testGetConfigurationOverrides().

File

core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php, line 99

Class

FileCacheFactoryTest
@coversDefaultClass \Drupal\Component\FileCache\FileCacheFactory @group FileCache

Namespace

Drupal\Tests\Component\FileCache

Code

public function configurationDataProvider() {
    $data = [];
    // Get a unique FileCache class.
    $file_cache = $this->getMockBuilder(FileCache::class)
        ->disableOriginalConstructor()
        ->getMock();
    $class = get_class($file_cache);
    // Test fallback configuration.
    $data['fallback-configuration'] = [
        [],
        [],
        FileCache::class,
    ];
    // Test default configuration.
    $data['default-configuration'] = [
        [
            'default' => [
                'class' => $class,
            ],
        ],
        [],
        $class,
    ];
    // Test specific per collection setting.
    $data['collection-setting'] = [
        [
            'test_foo_settings' => [
                'class' => $class,
            ],
        ],
        [],
        $class,
    ];
    // Test default configuration plus specific per collection setting.
    $data['default-plus-collection-setting'] = [
        [
            'default' => [
                'class' => '\\stdClass',
            ],
            'test_foo_settings' => [
                'class' => $class,
            ],
        ],
        [],
        $class,
    ];
    // Test default configuration plus class specific override.
    $data['default-plus-class-override'] = [
        [
            'default' => [
                'class' => '\\stdClass',
            ],
        ],
        [
            'class' => $class,
        ],
        $class,
    ];
    // Test default configuration plus class specific override plus specific
    // per collection setting.
    $data['default-plus-class-plus-collection-setting'] = [
        [
            'default' => [
                'class' => '\\stdClass',
            ],
            'test_foo_settings' => [
                'class' => $class,
            ],
        ],
        [
            'class' => '\\stdClass',
        ],
        $class,
    ];
    return $data;
}

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