You are here

public function ConfigReverterTest::revertProvider in Configuration Update Manager 8

Data provider for self:testRevert().

File

tests/src/Unit/ConfigReverterTest.php, line 227

Class

ConfigReverterTest
Tests the \Drupal\config_update\ConfigReverter class.

Namespace

Drupal\Tests\config_update\Unit

Code

public function revertProvider() {
  return [
    // Elements: type, name, config name, return value,
    // config to set up before, config expected after. See also
    // getFromExtensionProvider().
    [
      'system.simple',
      'in.extension',
      'in.extension',
      TRUE,
      [
        'in.extension' => 'active',
      ],
      [
        'in.extension' => 'extension',
        '_core' => 'core_for_in.extension',
      ],
    ],
    [
      'foo',
      'one',
      'foo.bar.one',
      TRUE,
      [
        'foo.bar.one' => 'active',
        'id' => 'one',
      ],
      [
        'foo.bar.one' => 'extension',
        'id' => 'one',
        '_core' => 'core_for_foo.bar.one',
      ],
    ],
    [
      'system.simple',
      'in.both',
      'in.both',
      TRUE,
      [
        'in.both' => 'active',
      ],
      [
        'in.both' => 'extension',
        '_core' => 'core_for_in.both',
      ],
    ],
    [
      'system.simple',
      'in.optional',
      'in.optional',
      TRUE,
      [
        'in.optional' => 'active',
      ],
      [
        'in.optional' => 'optional',
        '_core' => 'core_for_in.optional',
      ],
    ],
    [
      'unknown',
      'in.extension',
      FALSE,
      FALSE,
      FALSE,
      FALSE,
    ],
    // Missing from extension storage.
    [
      'system.simple',
      'missing2',
      'missing2',
      FALSE,
      FALSE,
      FALSE,
    ],
    // Present in extension storage but missing from active storage.
    [
      'system.simple',
      'another',
      'another',
      FALSE,
      FALSE,
      FALSE,
    ],
  ];
}