You are here

public function ConfigActionsPluginTest::testOptionReplace in Config Actions 8

Test using @property@ replacement in options

File

tests/src/Kernel/ConfigActionsPluginTest.php, line 128

Class

ConfigActionsPluginTest
test the ConfigActions plugins

Namespace

Drupal\Tests\config_actions\Kernel

Code

public function testOptionReplace() {
  $action = [
    'plugin' => 'change',
    'source' => '@id@',
    'path' => [
      'label',
    ],
    'actions' => [
      'core.date_format.short' => [
        'value' => 'Test short date',
      ],
      'core.date_format.long' => [
        'value' => 'Test long date',
      ],
    ],
  ];
  $config = $this->configActions
    ->processAction($action);
  $short_config = $this
    ->getConfig('core.date_format.short');
  $long_config = $this
    ->getConfig('core.date_format.long');
  self::assertEquals('Test short date', $short_config['label']);
  self::assertEquals('Test long date', $long_config['label']);
}