You are here

public function ConfigHandlerTest::testGetPatchFileSerializerSupport in Update helper 8

Same name and namespace in other branches
  1. 2.x tests/src/Kernel/ConfigHandlerTest.php \Drupal\Tests\update_helper\Kernel\ConfigHandlerTest::testGetPatchFileSerializerSupport()

@covers \Drupal\update_helper\ConfigHandler::getPatchFile

File

tests/src/Kernel/ConfigHandlerTest.php, line 207

Class

ConfigHandlerTest
Automated tests for ConfigName class.

Namespace

Drupal\Tests\update_helper\Kernel

Code

public function testGetPatchFileSerializerSupport() {
  $configList = \Drupal::service('config_update.config_list');
  $configReverter = \Drupal::service('config_update.config_update');
  $configDiffer = \Drupal::service('update_helper.config_differ');
  $configDiffTransformer = \Drupal::service('update_helper.config_diff_transformer');
  $moduleHandler = \Drupal::service('module_handler');
  $configExporter = \Drupal::service('update_helper.config_exporter');
  $configHandlerYaml = new ConfigHandler($configList, $configReverter, $configDiffer, $configDiffTransformer, $moduleHandler, \Drupal::service('serialization.yaml'), $configExporter);
  $this
    ->assertStringEndsWith('config_handler_test.yml', $configHandlerYaml
    ->getPatchFile('update_helper', 'config_handler_test'));
  $configHandlerJson = new ConfigHandler($configList, $configReverter, $configDiffer, $configDiffTransformer, $moduleHandler, \Drupal::service('serialization.json'), $configExporter);
  $this
    ->assertStringEndsWith('config_handler_test.json', $configHandlerJson
    ->getPatchFile('update_helper', 'config_handler_test'));
  $configHandlerPhpSerialize = new ConfigHandler($configList, $configReverter, $configDiffer, $configDiffTransformer, $moduleHandler, \Drupal::service('serialization.phpserialize'), $configExporter);
  $this
    ->assertStringEndsWith('config_handler_test.serialized', $configHandlerPhpSerialize
    ->getPatchFile('update_helper', 'config_handler_test'));
}