3 namespace Drupal\Tests\node\Kernel\Plugin\migrate\source\d7;
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
8 * Tests D7 node type source plugin.
10 * @covers \Drupal\node\Plugin\migrate\source\d7\NodeType
14 class NodeTypeTest extends MigrateSqlSourceTestBase {
19 public static $modules = ['node', 'user', 'migrate_drupal'];
24 public function providerSource() {
28 $tests[0]['source_data']['node_type'] = [
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.',
35 'title_label' => 'Title',
40 'orig_type' => 'page',
46 '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.',
48 'title_label' => 'Title',
53 'orig_type' => 'story',
56 $tests[0]['source_data']['variable'] = [
58 'name' => 'node_options_page',
59 'value' => 'a:1:{i:0;s:6:"status";}',
62 'name' => 'node_options_story',
63 'value' => 'a:1:{i:0;s:6:"status";}',
66 $tests[0]['source_data']['field_config_instance'] = [
68 'entity_type' => 'node',
70 'field_name' => 'body',
71 'data' => 'a:1:{s:5:"label";s:4:"Body";}',
74 'entity_type' => 'node',
76 'field_name' => 'body',
77 'data' => 'a:1:{s:5:"label";s:4:"Body";}',
81 // The expected results.
82 $tests[0]['expected_data'] = $tests[0]['source_data']['node_type'];