X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fnode%2Ftests%2Fsrc%2FKernel%2FPlugin%2Fmigrate%2Fsource%2Fd7%2FNodeTypeTest.php;fp=web%2Fcore%2Fmodules%2Fnode%2Ftests%2Fsrc%2FKernel%2FPlugin%2Fmigrate%2Fsource%2Fd7%2FNodeTypeTest.php;h=1c738d1a880b6c7dc69d4a7330524c5653acb3eb;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/node/tests/src/Kernel/Plugin/migrate/source/d7/NodeTypeTest.php b/web/core/modules/node/tests/src/Kernel/Plugin/migrate/source/d7/NodeTypeTest.php new file mode 100644 index 000000000..1c738d1a8 --- /dev/null +++ b/web/core/modules/node/tests/src/Kernel/Plugin/migrate/source/d7/NodeTypeTest.php @@ -0,0 +1,87 @@ + 'page', + 'name' => 'Page', + 'base' => 'node', + 'description' => 'A page, similar in form to a story, is a simple method for creating and displaying information that rarely changes, such as an "About us" section of a website. By default, a page entry does not allow visitor comments and is not featured on the site\'s initial home page.', + 'help' => '', + 'title_label' => 'Title', + 'custom' => 1, + 'modified' => 0, + 'locked' => 0, + 'disabled' => 0, + 'orig_type' => 'page', + ], + [ + 'type' => 'story', + 'name' => 'Story', + 'base' => 'node', + 'description' => 'A story, similar in form to a page, 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 story entry. By default, a story entry is automatically featured on the site\'s initial home page, and provides the ability to post comments.', + 'help' => '', + 'title_label' => 'Title', + 'custom' => 1, + 'modified' => 0, + 'locked' => 0, + 'disabled' => 0, + 'orig_type' => 'story', + ], + ]; + $tests[0]['source_data']['variable'] = [ + [ + 'name' => 'node_options_page', + 'value' => 'a:1:{i:0;s:6:"status";}', + ], + [ + 'name' => 'node_options_story', + 'value' => 'a:1:{i:0;s:6:"status";}', + ], + ]; + $tests[0]['source_data']['field_config_instance'] = [ + [ + 'entity_type' => 'node', + 'bundle' => 'page', + 'field_name' => 'body', + 'data' => 'a:1:{s:5:"label";s:4:"Body";}', + ], + [ + 'entity_type' => 'node', + 'bundle' => 'story', + 'field_name' => 'body', + 'data' => 'a:1:{s:5:"label";s:4:"Body";}', + ], + ]; + + // The expected results. + $tests[0]['expected_data'] = $tests[0]['source_data']['node_type']; + + return $tests; + } + +}