You are here

public function ConfigDiffTransformerTest::transformDataProvider in Update helper 2.x

Same name and namespace in other branches
  1. 8 tests/src/Unit/ConfigDiffTransformerTest.php \Drupal\Tests\update_helper\Unit\ConfigDiffTransformerTest::transformDataProvider()

Data provider for transform and reverseTransform methods test.

Return value

array Return test cases for testProcessRiddleResponse.

File

tests/src/Unit/ConfigDiffTransformerTest.php, line 55

Class

ConfigDiffTransformerTest
Automated tests for the 'update_helper.config_diff_transformer' service.

Namespace

Drupal\Tests\update_helper\Unit

Code

public function transformDataProvider() {
  return [
    [
      [],
      [],
    ],
    [
      [
        'uuid' => '1234-5678-90',
        'id' => 'test.config.id',
        'short_text' => 'en',
        'long_text' => 'Automated tests for the ConfigDiffTransformer service.',
        'true_value' => TRUE,
        'false_value' => FALSE,
        'nested_array' => [
          'flat_array' => [
            'value2',
            'value1',
            'value3',
          ],
          'custom_key' => 'value',
        ],
        'empty_array' => [],
        'empty_string' => '',
        'null_value' => NULL,
      ],
      [
        'uuid : s:12:"1234-5678-90";',
        'id : s:14:"test.config.id";',
        'short_text : s:2:"en";',
        'long_text : s:54:"Automated tests for the ConfigDiffTransformer service.";',
        'true_value : b:1;',
        'false_value : b:0;',
        'nested_array',
        'nested_array::flat_array',
        'nested_array::flat_array::- : s:6:"value2";',
        'nested_array::flat_array::- : s:6:"value1";',
        'nested_array::flat_array::- : s:6:"value3";',
        'nested_array::custom_key : s:5:"value";',
        'empty_array : a:0:{}',
        'empty_string : s:0:"";',
        'null_value : N;',
      ],
    ],
  ];
}