UploadInstanceTest.php in Drupal 9
File
core/modules/file/tests/src/Kernel/Plugin/migrate/source/d6/UploadInstanceTest.php
View source
<?php
namespace Drupal\Tests\file\Kernel\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
class UploadInstanceTest extends MigrateSqlSourceTestBase {
protected static $modules = [
'file',
'migrate_drupal',
];
public function providerSource() {
$tests = [];
$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'),
],
];
$tests[0]['expected_data'] = [
[
'node_type' => 'article',
'max_filesize' => '16MB',
'file_extensions' => 'txt pdf',
],
];
return $tests;
}
}