function FilterIdTest::provideFilters

Same name and namespace in other branches
  1. 9 core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php \Drupal\Tests\filter\Kernel\Plugin\migrate\process\FilterIdTest::provideFilters()
  2. 8.9.x core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php \Drupal\Tests\filter\Kernel\Plugin\migrate\process\FilterIdTest::provideFilters()
  3. 10 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 static 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,
            NULL,
            TRUE,
        ],
        'non-transformation-only D7 contrib filter' => [
            'bbcode',
            'filter_null',
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.