38af680a1556580c12d542fe7addfd5769b73882
[yaffs-website] / web / core / modules / node / tests / src / Kernel / Plugin / migrate / source / d6 / NodeTypeTest.php
1 <?php
2
3 namespace Drupal\Tests\node\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests D6 node type source plugin.
9  *
10  * @covers \Drupal\node\Plugin\migrate\source\d6\NodeType
11  *
12  * @group node
13  */
14 class NodeTypeTest extends MigrateSqlSourceTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = ['node', 'user', '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' => 'page',
31         'name' => 'Page',
32         'module' => 'node',
33         'description' => 'A <em>page</em>, similar in form to a <em>story</em>, is a simple method for creating and displaying information that rarely changes, such as an "About us" section of a website. By default, a <em>page</em> entry does not allow visitor comments and is not featured on the site\'s initial home page.',
34         'help' => '',
35         'title_label' => 'Title',
36         'has_body' => 1,
37         'body_label' => 'Body',
38         'min_word_count' => 0,
39         'custom' => 1,
40         'modified' => 0,
41         'locked' => 0,
42         'orig_type' => 'page',
43       ],
44       [
45         'type' => 'story',
46         'name' => 'Story',
47         'module' => 'node',
48         'description' => 'A <em>story</em>, similar in form to a <em>page</em>, is ideal for creating and displaying content that informs or engages website visitors. Press releases, site announcements, and informal blog-like entries may all be created with a <em>story</em> entry. By default, a <em>story</em> entry is automatically featured on the site\'s initial home page, and provides the ability to post comments.',
49         'help' => '',
50         'title_label' => 'Title',
51         'has_body' => 1,
52         'body_label' => 'Body',
53         'min_word_count' => 0,
54         'custom' => 1,
55         'modified' => 0,
56         'locked' => 0,
57         'orig_type' => 'story',
58       ],
59     ];
60
61     // The expected results.
62     $tests[0]['expected_data'] = $tests[0]['source_data']['node_type'];
63
64     return $tests;
65   }
66
67 }