function UploadInstanceTest::providerSource

Same name in other branches
  1. 9 core/modules/file/tests/src/Kernel/Plugin/migrate/source/d6/UploadInstanceTest.php \Drupal\Tests\file\Kernel\Plugin\migrate\source\d6\UploadInstanceTest::providerSource()
  2. 8.9.x core/modules/file/tests/src/Kernel/Plugin/migrate/source/d6/UploadInstanceTest.php \Drupal\Tests\file\Kernel\Plugin\migrate\source\d6\UploadInstanceTest::providerSource()
  3. 10 core/modules/file/tests/src/Kernel/Plugin/migrate/source/d6/UploadInstanceTest.php \Drupal\Tests\file\Kernel\Plugin\migrate\source\d6\UploadInstanceTest::providerSource()

File

core/modules/file/tests/src/Kernel/Plugin/migrate/source/d6/UploadInstanceTest.php, line 28

Class

UploadInstanceTest
Tests D6 d6_upload_instance source plugin.

Namespace

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

Code

public static function providerSource() {
    $tests = [];
    // The source data.
    $tests[0]['source_data']['node_type'] = [
        [
            'type' => 'article',
        ],
        [
            'type' => 'company',
        ],
    ];
    $tests[0]['source_data']['variable'] = [
        [
            'name' => 'upload_article',
            'value' => serialize(TRUE),
        ],
        [
            'name' => 'upload_company',
            'value' => serialize(FALSE),
        ],
        [
            'name' => 'upload_uploadsize_default',
            'value' => serialize(16),
        ],
        [
            'name' => 'upload_extensions_default',
            'value' => serialize('txt pdf'),
        ],
    ];
    // The expected results.
    $tests[0]['expected_data'] = [
        [
            'node_type' => 'article',
            'max_filesize' => '16MB',
            'file_extensions' => 'txt pdf',
        ],
    ];
    return $tests;
}

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