cc8c9b36faf048ea4fd0c64564a34236de915ea0
[yaffs-website] / web / core / modules / file / tests / src / Kernel / Plugin / migrate / source / d6 / FileTest.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 file source plugin.
9  *
10  * @covers \Drupal\file\Plugin\migrate\source\d6\File
11  *
12  * @group file
13  */
14 class FileTest 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']['files'] = [
29       [
30         'fid' => 1,
31         'uid' => 1,
32         'filename' => 'migrate-test-file-1.pdf',
33         'filepath' => 'sites/default/files/migrate-test-file-1.pdf',
34         'filemime' => 'application/pdf',
35         'filesize' => 890404,
36         'status' => 1,
37         'timestamp' => 1382255613,
38       ],
39       [
40         'fid' => 2,
41         'uid' => 1,
42         'filename' => 'migrate-test-file-2.pdf',
43         'filepath' => 'sites/default/files/migrate-test-file-2.pdf',
44         'filemime' => 'application/pdf',
45         'filesize' => 204124,
46         'status' => 1,
47         'timestamp' => 1382255662,
48       ],
49     ];
50
51     // The expected results are identical to the source data.
52     $tests[0]['expected_data'] = $tests[0]['source_data']['files'];
53
54     return $tests;
55   }
56
57 }