You are here

public function FilterIdTest::provideFilters in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php \Drupal\Tests\filter\Kernel\Plugin\migrate\process\FilterIdTest::provideFilters()
  2. 9 core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php \Drupal\Tests\filter\Kernel\Plugin\migrate\process\FilterIdTest::provideFilters()

Provides filter ids for testing transformations.

Return value

array Formatted as $source_id, $transformed_id, $invalid_id. When $invalid_id is provided the transformation should fail with the supplied id.

File

core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php, line 104

Class

FilterIdTest
Unit tests of the filter_id plugin.

Namespace

Drupal\Tests\filter\Kernel\Plugin\migrate\process

Code

public function provideFilters() {
  return [
    'filter ID mapped to plugin that exists' => [
      'foo',
      'filter_html',
    ],
    'filter ID not mapped but unchanged from the source and the plugin exists' => [
      'filter_html',
      'filter_html',
    ],
    'filter ID mapped to plugin that does not exist' => [
      'baz',
      'filter_null',
      'php_code',
    ],
    'filter ID not mapped but unchanged from the source and the plugin does not exist' => [
      'php_code',
      'filter_null',
      'php_code',
    ],
    'filter ID set and the plugin does not exist' => [
      [
        'filter',
        1,
      ],
      'filter_null',
      'filter:1',
    ],
    'transformation-only D7 contrib filter' => [
      'editor_align',
      '',
      NULL,
      TRUE,
    ],
    'non-transformation-only D7 contrib filter' => [
      'bbcode',
      'filter_null',
    ],
  ];
}