function CommentVariableTest::providerSource

Overrides MigrateSourceTestBase::providerSource

File

core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d6/CommentVariableTest.php, line 35

Class

CommentVariableTest
Tests d6_comment_variable source plugin.

Namespace

Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6

Code

public function providerSource() {
    $tests = [];
    // The source data.
    $tests[0]['source_data']['node_type'] = [
        [
            'type' => 'page',
        ],
    ];
    $tests[0]['source_data']['variable'] = [
        [
            'name' => 'comment_page',
            'value' => serialize(1),
        ],
        [
            'name' => 'comment_default_mode_page',
            'value' => serialize(1),
        ],
        [
            'name' => 'comment_default_order_page',
            'value' => serialize(1),
        ],
        [
            'name' => 'comment_default_per_page_page',
            'value' => serialize(50),
        ],
        [
            'name' => 'comment_controls_page',
            'value' => serialize(1),
        ],
        [
            'name' => 'comment_anonymous_page',
            'value' => serialize(1),
        ],
        [
            'name' => 'comment_subject_field_page',
            'value' => serialize(1),
        ],
        [
            'name' => 'comment_preview_page',
            'value' => serialize(1),
        ],
        [
            'name' => 'comment_form_location_page',
            'value' => serialize(1),
        ],
    ];
    // The expected results.
    $tests[0]['expected_data'] = [
        [
            'comment' => '1',
            'comment_default_mode' => '1',
            'comment_default_order' => '1',
            'comment_default_per_page' => '50',
            'comment_controls' => '1',
            'comment_anonymous' => '1',
            'comment_subject_field' => '1',
            'comment_preview' => '1',
            'comment_form_location' => '1',
            'node_type' => 'page',
            'comment_type' => 'comment',
        ],
    ];
    return $tests;
}

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