Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / file / tests / src / Kernel / Plugin / migrate / source / d6 / UploadInstanceTest.php
1 <?php
2
3 namespace Drupal\Tests\file\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests D6 d6_upload_instance source plugin.
9  *
10  * @covers \Drupal\file\Plugin\migrate\source\d6\UploadInstance
11  *
12  * @group file
13  */
14 class UploadInstanceTest extends MigrateSqlSourceTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = ['file', 'migrate_drupal'];
20
21   /**
22    * {@inheritdoc}
23    */
24   public function providerSource() {
25     $tests = [];
26
27     // The source data.
28     $tests[0]['source_data']['node_type'] = [
29       [
30         'type' => 'article',
31       ],
32       [
33         'type' => 'company',
34       ],
35     ];
36
37     $tests[0]['source_data']['variable'] = [
38       [
39         'name' => 'upload_article',
40         'value' => serialize(TRUE),
41       ],
42       [
43         'name' => 'upload_company',
44         'value' => serialize(FALSE),
45       ],
46       [
47         'name' => 'upload_uploadsize_default',
48         'value' => serialize(16),
49       ],
50       [
51         'name' => 'upload_extensions_default',
52         'value' => serialize('txt pdf'),
53       ],
54     ];
55
56     // The expected results.
57     $tests[0]['expected_data'] = [
58       [
59         'node_type' => 'article',
60         'max_filesize' => '16MB',
61         'file_extensions' => 'txt pdf',
62       ],
63     ];
64
65     return $tests;
66   }
67
68 }