You are here

public function ConfigActionsPluginBaseTest::testSetOptions in Config Actions 8

@covers ::setOptions

File

tests/src/Unit/ConfigActionsPluginBaseTest.php, line 60

Class

ConfigActionsPluginBaseTest
test the ConfigActionsPluginBase class

Namespace

Drupal\Tests\config_actions\Unit

Code

public function testSetOptions() {
  $options = [
    'source' => 'node.type.@bundle@',
    'replace' => [
      '@bundle@' => 'article',
    ],
  ];
  $this->definition['replace_in'] = [
    'source',
  ];
  $plugin = new ConfigActionsPluginBase($options, 'test', $this->definition, $this->configActions);
  $plugin
    ->setOptions($options);
  $this
    ->assertEquals('node.type.article', $plugin
    ->getOption('source'));
}