25d0906a36c13bccc4047953441a20ef10810e43
[yaffs-website] / web / core / modules / book / tests / src / Kernel / Plugin / migrate / source / d6 / BookTest.php
1 <?php
2
3 namespace Drupal\Tests\book\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * @covers \Drupal\book\Plugin\migrate\source\d6\Book
9  * @group book
10  */
11 class BookTest extends MigrateSqlSourceTestBase {
12
13   /**
14    * {@inheritdoc}
15    */
16   public static $modules = ['book', 'migrate_drupal', 'node'];
17
18   /**
19    * {@inheritdoc}
20    */
21   public function providerSource() {
22     $tests = [];
23
24     // The source data.
25     $tests[0]['source_data']['book'] = [
26       [
27         'mlid' => '1',
28         'nid' => '4',
29         'bid' => '4',
30       ],
31     ];
32     $tests[0]['source_data']['menu_links'] = [
33       [
34         'menu_name' => 'book-toc-1',
35         'mlid' => '1',
36         'plid' => '0',
37         'link_path' => 'node/4',
38         'router_path' => 'node/%',
39         'link_title' => 'Test top book title',
40         'options' => 'a:0:{}',
41         'module' => 'book',
42         'hidden' => '0',
43         'external' => '0',
44         'has_children' => '1',
45         'expanded' => '0',
46         'weight' => '-10',
47         'depth' => '1',
48         'customized' => '0',
49         'p1' => '1',
50         'p2' => '0',
51         'p3' => '0',
52         'p4' => '0',
53         'p5' => '0',
54         'p6' => '0',
55         'p7' => '0',
56         'p8' => '0',
57         'p9' => '0',
58         'updated' => '0',
59       ],
60     ];
61
62     // The expected results.
63     $tests[0]['expected_data'] = [
64       [
65         'nid' => '4',
66         'bid' => '4',
67         'mlid' => '1',
68         'plid' => '0',
69         'weight' => '-10',
70         'p1' => '1',
71         'p2' => '0',
72         'p3' => '0',
73         'p4' => '0',
74         'p5' => '0',
75         'p6' => '0',
76         'p7' => '0',
77         'p8' => '0',
78         'p9' => '0',
79       ],
80     ];
81     return $tests;
82   }
83
84 }