diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php new file mode 100644 index 0000000..8710662 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorFeed.php @@ -0,0 +1,129 @@ +createTable('aggregator_feed', array( + 'description' => 'Stores feeds to be parsed by the aggregator.', + 'fields' => array( + 'fid' => array( + 'type' => 'serial', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique feed ID.', + ), + 'title' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Title of the feed.', + ), + 'url' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'URL to the feed.', + ), + 'refresh' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'How often to check for new feed items, in seconds.', + ), + 'checked' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Last time feed was checked for new items, as Unix timestamp.', + ), + 'link' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'The parent website of the feed; comes from the <link> element in the feed.', + ), + 'description' => array( + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + 'description' => "The parent website's description; comes from the <description> element in the feed.", + ), + 'image' => array( + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + 'description' => 'An image representing the feed.', + ), + 'etag' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Entity tag HTTP response header, used for validating cache.', + ), + 'modified' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'When the feed was last modified, as a Unix timestamp.', + ), + 'block' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => "Number of items to display in the feed's block.", + ) + ), + 'primary key' => array('fid'), + 'unique keys' => array( + 'url' => array('url'), + 'title' => array('title'), + ), + )); + + $this->database->insert('aggregator_feed')->fields(array( + 'fid', + 'title', + 'url', + 'refresh', + 'checked', + 'link', + 'description', + 'image', + 'etag', + 'modified', + 'block', + )) + ->values(array( + 'fid' => 5, + 'title' => 'Know Your Meme', + 'url' => 'http://knowyourmeme.com/newsfeed.rss', + 'refresh' => 900, + 'checked' => 1387659487, + 'link' => 'http://knowyourmeme.com', + 'description' => 'New items added to the News Feed', + 'image' => 'http://b.thumbs.redditmedia.com/harEHsUUZVajabtC.png', + 'etag' => '"213cc1365b96c310e92053c5551f0504"', + 'modified' => 0, + 'block' => 5, + )) + ->execute(); + $this->setModuleVersion('aggregator', 6001); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php new file mode 100644 index 0000000..c866631 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6AggregatorItem.php @@ -0,0 +1,100 @@ +createTable('aggregator_item', array( + 'description' => 'Stores the individual items imported from feeds.', + 'fields' => array( + 'iid' => array( + 'type' => 'serial', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique ID for feed item.', + ), + 'fid' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {aggregator_feed}.fid to which this item belongs.', + ), + 'title' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Title of the feed item.', + ), + 'link' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Link to the feed item.', + ), + 'author' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Author of the feed item.', + ), + 'description' => array( + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + 'description' => 'Body of the feed item.', + ), + 'timestamp' => array( + 'type' => 'int', + 'not null' => FALSE, + 'description' => 'Post date of feed item, as a Unix timestamp.', + ), + 'guid' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + 'description' => 'Unique identifier for the feed item.', + ), + ), + 'primary key' => array('iid'), + 'indexes' => array('fid' => array('fid')), + )); + + $this->database->insert('aggregator_item')->fields(array( + 'iid', + 'fid', + 'title', + 'link', + 'author', + 'description', + 'timestamp', + 'guid', + )) + ->values(array( + 'iid' => 1, + 'fid' => 5, + 'title' => 'This (three) weeks in Drupal Core - January 10th 2014', + 'link' => 'https://groups.drupal.org/node/395218', + 'author' => 'larowlan', + 'description' => "

What's new with Drupal 8?

", + 'timestamp' => 1389297196, + 'guid' => '395218 at https://groups.drupal.org', + )) + ->execute(); + + $this->setModuleVersion('aggregator', '6001'); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php new file mode 100644 index 0000000..3144fb7 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Block.php @@ -0,0 +1,311 @@ +createTable('blocks', array( + 'fields' => array( + 'bid' => array( + 'type' => 'serial', + 'not null' => TRUE, + ), + 'module' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + ), + 'delta' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '0', + ), + 'theme' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + ), + 'status' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'region' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + ), + 'custom' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'throttle' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'visibility' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'pages' => array( + 'type' => 'text', + 'not null' => TRUE, + ), + 'title' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + ), + 'cache' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 1, + 'size' => 'tiny', + ), + ), + 'primary key' => array( + 'bid', + ), + 'unique keys' => array( + 'tmd' => array( + 'theme', + 'module', + 'delta', + ), + ), + 'indexes' => array( + 'list' => array( + 'theme', + 'status', + 'region', + 'weight', + 'module', + ), + ), + )); + $this->createTable('blocks_roles', array( + 'fields' => array( + 'module' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + ), + 'delta' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + ), + 'rid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + ), + 'primary key' => array( + 'module', + 'delta', + 'rid', + ), + 'indexes' => array( + 'rid' => array( + 'rid', + ), + ), + 'module' => 'block', + 'name' => 'blocks_roles', + )); + $this->database->insert('blocks')->fields(array( + 'bid', + 'module', + 'delta', + 'theme', + 'status', + 'weight', + 'region', + 'custom', + 'throttle', + 'visibility', + 'pages', + 'title', + 'cache', + )) + ->values(array( + 'bid' => '1', + 'module' => 'user', + 'delta' => '0', + 'theme' => 'garland', + 'status' => '1', + 'weight' => '0', + 'region' => 'left', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1' + )) + ->values(array( + 'bid' => '2', + 'module' => 'user', + 'delta' => '1', + 'theme' => 'garland', + 'status' => '1', + 'weight' => '0', + 'region' => 'left', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1' + )) + ->values(array( + 'bid' => '3', + 'module' => 'system', + 'delta' => '0', + 'theme' => 'garland', + 'status' => '1', + 'weight' => '-5', + 'region' => 'footer', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1' + )) + ->values(array( + 'bid' => '4', + 'module' => 'comment', + 'delta' => '0', + 'theme' => 'garland', + 'status' => '0', + 'weight' => '-6', + 'region' => '', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '1' + )) + ->values(array( + 'bid' => '5', + 'module' => 'menu', + 'delta' => 'primary-links', + 'theme' => 'garland', + 'status' => '1', + 'weight' => '-5', + 'region' => 'header', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1' + )) + ->values(array( + 'bid' => '6', + 'module' => 'menu', + 'delta' => 'secondary-links', + 'theme' => 'garland', + 'status' => '0', + 'weight' => '-5', + 'region' => '', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1' + )) + ->values(array( + 'bid' => '7', + 'module' => 'node', + 'delta' => '0', + 'theme' => 'garland', + 'status' => '0', + 'weight' => '-4', + 'region' => '', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1' + )) + ->values(array( + 'bid' => '8', + 'module' => 'user', + 'delta' => '2', + 'theme' => 'garland', + 'status' => '0', + 'weight' => '-3', + 'region' => '', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '1' + )) + ->values(array( + 'bid' => '9', + 'module' => 'user', + 'delta' => '3', + 'theme' => 'garland', + 'status' => '0', + 'weight' => '-1', + 'region' => '', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1' + )) + ->values(array( + 'bid' => '10', + 'module' => 'block', + 'delta' => '1', + 'theme' => 'garland', + 'status' => '1', + 'weight' => '0', + 'region' => 'content', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '1', + 'pages' => '', + 'title' => 'Static Block', + 'cache' => '-1' + )) + ->execute(); + } +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php new file mode 100644 index 0000000..5ab6f92 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Book.php @@ -0,0 +1,436 @@ +createTable('book', array( + 'fields' => array( + 'mlid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'nid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'bid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'primary key' => array( + 'mlid', + ), + 'unique keys' => array( + 'nid' => array( + 'nid', + ), + ), + 'indexes' => array( + 'bid' => array( + 'bid', + ), + ), + 'module' => 'book', + 'name' => 'book', + )); + $this->createTable('menu_links', array( + 'fields' => array( + 'menu_name' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'mlid' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'plid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'link_path' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'router_path' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'link_title' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'options' => array( + 'type' => 'text', + 'not null' => FALSE, + ), + 'module' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => 'system', + ), + 'hidden' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'small', + ), + 'external' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'small', + ), + 'has_children' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'small', + ), + 'expanded' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'small', + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'depth' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'small', + ), + 'customized' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'small', + ), + 'p1' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'p2' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'p3' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'p4' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'p5' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'p6' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'p7' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'p8' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'p9' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'updated' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'small', + ), + ), + 'indexes' => array( + 'path_menu' => array( + array( + 'link_path', + 128, + ), + 'menu_name', + ), + 'menu_plid_expand_child' => array( + 'menu_name', + 'plid', + 'expanded', + 'has_children', + ), + 'menu_parents' => array( + 'menu_name', + 'p1', + 'p2', + 'p3', + 'p4', + 'p5', + 'p6', + 'p7', + 'p8', + 'p9', + ), + 'router_path' => array( + array( + 'router_path', + 128, + ), + ), + ), + 'primary key' => array( + 'mlid', + ), + 'module' => 'system', + 'name' => 'menu_links', + )); + $this->database->insert('book')->fields(array( + 'mlid', + 'nid', + 'bid', + )) + ->values(array( + 'mlid' => '1', + 'nid' => '4', + 'bid' => '4', + )) + ->values(array( + 'mlid' => '2', + 'nid' => '5', + 'bid' => '4', + )) + ->values(array( + 'mlid' => '3', + 'nid' => '6', + 'bid' => '4', + )) + ->values(array( + 'mlid' => '4', + 'nid' => '7', + 'bid' => '4', + )) + ->values(array( + 'mlid' => '5', + 'nid' => '8', + 'bid' => '8', + )) + ->execute(); + $this->database->insert('menu_links')->fields(array( + 'menu_name', + 'mlid', + 'plid', + 'link_path', + 'router_path', + 'link_title', + 'options', + 'module', + 'hidden', + 'external', + 'has_children', + 'expanded', + 'weight', + 'depth', + 'customized', + 'p1', + 'p2', + 'p3', + 'p4', + 'p5', + 'p6', + 'p7', + 'p8', + 'p9', + 'updated', + )) + ->values(array( + 'menu_name' => 'book-toc-1', + 'mlid' => '1', + 'plid' => '0', + 'link_path' => 'node/4', + 'router_path' => 'node/%', + 'link_title' => 'Test top book title', + 'options' => 'a:0:{}', + 'module' => 'book', + 'hidden' => '0', + 'external' => '0', + 'has_children' => '1', + 'expanded' => '0', + 'weight' => '-10', + 'depth' => '1', + 'customized' => '0', + 'p1' => '1', + 'p2' => '0', + 'p3' => '0', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', + )) + ->values(array( + 'menu_name' => 'book-toc-1', + 'mlid' => '2', + 'plid' => '1', + 'link_path' => 'node/5', + 'router_path' => 'node/%', + 'link_title' => 'Test book title child 1', + 'options' => 'a:0:{}', + 'module' => 'book', + 'hidden' => '0', + 'external' => '0', + 'has_children' => '1', + 'expanded' => '0', + 'weight' => '0', + 'depth' => '2', + 'customized' => '0', + 'p1' => '1', + 'p2' => '2', + 'p3' => '0', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', + )) + ->values(array( + 'menu_name' => 'book-toc-1', + 'mlid' => '3', + 'plid' => '2', + 'link_path' => 'node/6', + 'router_path' => 'node/%', + 'link_title' => 'Test book title child 1.1', + 'options' => 'a:0:{}', + 'module' => 'book', + 'hidden' => '0', + 'external' => '0', + 'has_children' => '0', + 'expanded' => '0', + 'weight' => '0', + 'depth' => '3', + 'customized' => '0', + 'p1' => '1', + 'p2' => '2', + 'p3' => '3', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', + )) + ->values(array( + 'menu_name' => 'book-toc-1', + 'mlid' => '4', + 'plid' => '2', + 'link_path' => 'node/7', + 'router_path' => 'node/%', + 'link_title' => 'Test book title child 1.2', + 'options' => 'a:0:{}', + 'module' => 'book', + 'hidden' => '0', + 'external' => '0', + 'has_children' => '0', + 'expanded' => '0', + 'weight' => '0', + 'depth' => '3', + 'customized' => '0', + 'p1' => '1', + 'p2' => '2', + 'p3' => '4', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', + )) + ->values(array( + 'menu_name' => 'book-toc-2', + 'mlid' => '5', + 'plid' => '0', + 'link_path' => 'node/8', + 'router_path' => 'node/%', + 'link_title' => 'Test top book 2 title', + 'options' => 'a:0:{}', + 'module' => 'book', + 'hidden' => '0', + 'external' => '0', + 'has_children' => '1', + 'expanded' => '0', + 'weight' => '-10', + 'depth' => '1', + 'customized' => '0', + 'p1' => '5', + 'p2' => '0', + 'p3' => '0', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', + )) + ->execute(); + } +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php new file mode 100644 index 0000000..d042f72 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Box.php @@ -0,0 +1,64 @@ +createTable('boxes', array( + 'description' => 'Stores contents of custom-made blocks.', + 'fields' => array( + 'bid' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'description' => "The block's {blocks}.bid.", + ), + 'body' => array( + 'type' => 'text', + 'not null' => FALSE, + 'size' => 'big', + 'description' => 'Block contents.', + ), + 'info' => array( + 'type' => 'varchar', + 'length' => 128, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Block description.', + ), + 'format' => array( + 'type' => 'int', + 'size' => 'small', + 'not null' => TRUE, + 'default' => 0, + 'description' => "Block body's {filter_formats}.format; for example, 1 = Filtered HTML.", + ), + ), + 'unique keys' => array('info' => array('info')), + 'primary key' => array('bid'), + )); + + $this->database->insert('boxes')->fields(array( + 'bid', + 'body', + 'info', + 'format', + )) + ->values(array( + 'bid' => '1', + 'body' => '

My custom block body

', + 'info' => 'My block 1', + 'format' => 2, + )) + ->execute(); + } +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php new file mode 100644 index 0000000..0a938a0 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Comment.php @@ -0,0 +1,189 @@ +createTable('comments', array( + 'description' => 'Stores comments and associated data.', + 'fields' => array( + 'cid' => array( + 'type' => 'serial', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique comment ID.', + ), + 'pid' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {comments}.cid to which this comment is a reply. If set to 0, this comment is not a reply to an existing comment.', + ), + 'nid' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {node}.nid to which this comment is a reply.', + ), + 'uid' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {users}.uid who authored the comment. If set to 0, this comment was created by an anonymous user.', + ), + 'subject' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + 'description' => 'The comment title.', + ), + 'comment' => array( + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + 'description' => 'The comment body.', + ), + 'hostname' => array( + 'type' => 'varchar', + 'length' => 128, + 'not null' => TRUE, + 'default' => '', + 'description' => "The author's host name.", + ), + 'timestamp' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The time that the comment was created, or last edited by its author, as a Unix timestamp.', + ), + 'status' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'The published status of a comment. (0 = Published, 1 = Not Published)', + ), + 'format' => array( + 'type' => 'int', + 'size' => 'small', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {filter_formats}.format of the comment body.', + ), + 'thread' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'description' => "The vancode representation of the comment's place in a thread.", + ), + 'name' => array( + 'type' => 'varchar', + 'length' => 60, + 'not null' => FALSE, + 'description' => "The comment author's name. Uses {users}.name if the user is logged in, otherwise uses the value typed into the comment form.", + ), + 'mail' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => FALSE, + 'description' => "The comment author's e-mail address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on.", + ), + 'homepage' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + 'description' => "The comment author's home page address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on.", + ), + ), + 'indexes' => array( + 'pid' => array('pid'), + 'nid' => array('nid'), + 'comment_uid' => array('uid'), + 'status' => array('status'), // This index is probably unused + ), + 'primary key' => array('cid'), + )); + $this->database->insert('comments')->fields(array( + 'cid', + 'pid', + 'nid', + 'uid', + 'subject', + 'comment', + 'hostname', + 'timestamp', + 'status', + 'format', + 'thread', + 'name', + 'mail', + 'homepage', + )) + // The comment structure is: + // -1 + // -3 + // --2 + ->values(array( + 'cid' => 1, + 'pid' => 0, + 'nid' => 1, + 'uid' => 0, + 'subject' => 'The first comment.', + 'comment' => 'The first comment body.', + 'hostname' => '127.0.0.1', + 'timestamp' => 1390264918, + 'status' => 0, + 'format' => 1, + 'thread' => '01/', + 'name' => '1st comment author name', + 'mail' => 'comment1@example.com', + 'homepage' => 'http://drupal.org', + )) + ->values(array( + 'cid' => 2, + 'pid' => 3, + 'nid' => 1, + 'uid' => 0, + 'subject' => 'The response to the second comment.', + 'comment' => 'The second comment response body.', + 'hostname' => '127.0.0.1', + 'timestamp' => 1390264938, + 'status' => 0, + 'format' => 1, + 'thread' => '02/01', + 'name' => '3rd comment author name', + 'mail' => 'comment3@example.com', + 'homepage' => 'http://drupal.org', + )) + ->values(array( + 'cid' => 3, + 'pid' => 0, + 'nid' => 1, + 'uid' => 0, + 'subject' => 'The second comment.', + 'comment' => 'The second comment body.', + 'hostname' => '127.0.0.1', + 'timestamp' => 1390264948, + // This comment is unpublished. + 'status' => 1, + 'format' => 1, + 'thread' => '02/', + 'name' => '3rd comment author name', + 'mail' => 'comment3@example.com', + 'homepage' => 'http://drupal.org', + )) + ->execute(); + $this->setModuleVersion('comment', '6001'); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php new file mode 100644 index 0000000..9d150f2 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6CommentVariable.php @@ -0,0 +1,238 @@ +createTable('variable'); + $this->createTable('node_type', array( + 'fields' => array( + 'type' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + ), + 'name' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'module' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + ), + 'description' => array( + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'medium', + ), + 'help' => array( + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'medium', + ), + 'has_title' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'size' => 'tiny', + ), + 'title_label' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'has_body' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'size' => 'tiny', + ), + 'body_label' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'min_word_count' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'size' => 'small', + ), + 'custom' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'modified' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'locked' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'orig_type' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + ), + 'primary key' => array( + 'type', + ), + 'module' => 'node', + 'name' => 'node_type', + )); + $this->database->insert('node_type')->fields(array( + 'type', + 'name', + 'module', + 'description', + 'help', + 'has_title', + 'title_label', + 'has_body', + 'body_label', + 'min_word_count', + 'custom', + 'modified', + 'locked', + 'orig_type', + )) + ->values(array( + 'type' => 'page', + 'name' => 'Page', + 'module' => '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' => '', + 'has_title' => '1', + 'title_label' => 'Title', + 'has_body' => '1', + 'body_label' => 'Body', + 'min_word_count' => '0', + 'custom' => '1', + 'modified' => '1', + 'locked' => '0', + 'orig_type' => 'page', + )) + ->values(array( + 'type' => 'story', + 'name' => 'Story', + 'module' => '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' => '', + 'has_title' => '1', + 'title_label' => 'Title', + 'has_body' => '1', + 'body_label' => 'Body', + 'min_word_count' => '0', + 'custom' => '1', + 'modified' => '1', + 'locked' => '0', + 'orig_type' => 'story', + )) + ->execute(); + $this->database->insert('variable')->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => 'comment_anonymous_page', + 'value' => 'i:0;', + )) + ->values(array( + 'name' => 'comment_anonymous_story', + 'value' => 'i:1;', + )) + ->values(array( + 'name' => 'comment_controls_page', + 'value' => 's:1:"3";', + )) + ->values(array( + 'name' => 'comment_controls_story', + 'value' => 's:1:"3";', + )) + ->values(array( + 'name' => 'comment_default_mode_page', + 'value' => 's:1:"4";', + )) + ->values(array( + 'name' => 'comment_default_mode_story', + 'value' => 's:1:"2";', + )) + ->values(array( + 'name' => 'comment_default_order_page', + 'value' => 's:1:"1";', + )) + ->values(array( + 'name' => 'comment_default_order_story', + 'value' => 's:1:"1";', + )) + ->values(array( + 'name' => 'comment_default_per_page_page', + 'value' => 's:2:"50";', + )) + ->values(array( + 'name' => 'comment_default_per_page_story', + 'value' => 's:2:"70";', + )) + ->values(array( + 'name' => 'comment_form_location_page', + 'value' => 's:1:"0";', + )) + ->values(array( + 'name' => 'comment_form_location_story', + 'value' => 's:1:"0";', + )) + ->values(array( + 'name' => 'comment_page', + 'value' => 's:1:"0";', + )) + ->values(array( + 'name' => 'comment_preview_page', + 'value' => 's:1:"1";', + )) + ->values(array( + 'name' => 'comment_preview_story', + 'value' => 's:1:"0";', + )) + ->values(array( + 'name' => 'comment_story', + 'value' => 's:1:"2";', + )) + ->values(array( + 'name' => 'comment_subject_field_page', + 'value' => 's:1:"1";', + )) + ->values(array( + 'name' => 'comment_subject_field_story', + 'value' => 's:1:"0";', + )) + ->execute(); + $this->setModuleVersion('comment', '6001'); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php new file mode 100644 index 0000000..541b6d2 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6ContactCategory.php @@ -0,0 +1,81 @@ +createTable('contact', array( + 'description' => 'Contact form category settings.', + 'fields' => array( + 'cid' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'description' => 'Primary Key: Unique category ID.', + ), + 'category' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Category name.', + 'translatable' => TRUE, + ), + 'recipients' => array( + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + 'description' => 'Comma-separated list of recipient e-mail addresses.', + ), + 'reply' => array( + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + 'description' => 'Text of the auto-reply message.', + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => "The category's weight.", + ), + 'selected' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Flag to indicate whether or not category is selected by default. (1 = Yes, 0 = No)', + ), + ), + 'primary key' => array('cid'), + 'unique keys' => array( + 'category' => array('category'), + ), + 'indexes' => array( + 'list' => array('weight', 'category'), + ), + )); + $this->database->insert('contact')->fields(array('cid', 'category', 'recipients', 'reply', 'weight', 'selected')) + ->values(array( + 'cid' => '1', + 'category' => 'Website feedback', + 'recipients' => 'admin@example.com', + 'reply' => '', + 'weight' => '0', + 'selected' => '1', + )) + ->execute(); + $this->setModuleVersion('contact', '6001'); + } +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php new file mode 100644 index 0000000..c126fee --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6DateFormat.php @@ -0,0 +1,34 @@ +createTable('variable'); + $this->database->insert('variable')->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => 'date_format_long', + 'value' => 's:24:"\\L\\O\\N\\G l, F j, Y - H:i";', + )) + ->values(array( + 'name' => 'date_format_medium', + 'value' => 's:27:"\\M\\E\\D\\I\\U\\M D, m/d/Y - H:i";', + )) + ->values(array( + 'name' => 'date_format_short', + 'value' => 's:22:"\\S\\H\\O\\R\\T m/d/Y - H:i";', + )) + ->execute(); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php new file mode 100644 index 0000000..77500e2 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6FieldInstance.php @@ -0,0 +1,853 @@ +createTable('content_node_field_instance', array( + 'description' => 'Table that contains field instance settings.', + 'fields' => array( + 'field_name' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'type_name' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'label' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'widget_type' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'widget_settings' => array( + 'type' => 'text', + 'size' => 'medium', + 'not null' => TRUE, + 'serialize' => TRUE, + ), + 'display_settings' => array( + 'type' => 'text', + 'size' => 'medium', + 'not null' => TRUE, + 'serialize' => TRUE, + ), + 'description' => array( + 'type' => 'text', + 'size' => 'medium', + 'not null' => TRUE, + ), + 'widget_module' => array( + 'type' => 'varchar', + 'length' => 127, + 'not null' => TRUE, + 'default' => '', + ), + 'widget_active' => array( + 'type' => 'int', + 'size' => 'tiny', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'primary key' => array('field_name', 'type_name'), + )); + + $this->database->insert('content_node_field_instance')->fields(array( + 'field_name', + 'type_name', + 'weight', + 'label', + 'widget_type', + 'widget_settings', + 'display_settings', + 'description', + )) + ->values(array( + 'field_name' => 'field_test', + 'type_name' => 'story', + 'weight' => 1, + 'label' => 'Text Field', + 'widget_type' => 'text_textfield', + 'widget_settings' => serialize(array( + 'rows' => 5, + 'size' => '60', + 'default_value' => array( + 0 => array( + 'value' => 'text for default value', + '_error_element' => 'default_value_widget][field_test][0][value', + ), + ), + 'default_value_php' => NULL, + )), + 'display_settings' => serialize(array( + 'weight' => 1, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 1 => array( + 'format' => 'default', + 'exclude' => 0, + ), + 'teaser' => array( + 'format' => 'trimmed', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'trimmed', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example text field.', + )) + ->values(array( + 'field_name' => 'field_test', + 'type_name' => 'article', + 'weight' => 1, + 'label' => 'Text Field', + 'widget_type' => 'text_textfield', + 'widget_settings' => serialize(array( + 'rows' => 5, + 'size' => '60', + 'default_value' => array( + 0 => array( + 'value' => 'text for default value', + '_error_element' => 'default_value_widget][field_test][0][value', + ), + ), + 'default_value_php' => NULL, + )), + 'display_settings' => serialize(array( + 'weight' => 1, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'trimmed', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'trimmed', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example textfield.', + )) + ->values(array( + 'field_name' => 'field_test_two', + 'type_name' => 'story', + 'weight' => 2, + 'label' => 'Integer Field', + 'widget_type' => 'number', + 'widget_settings' => 'a:2:{s:13:"default_value";a:1:{i:0;a:2:{s:5:"value";s:0:"";s:14:"_error_element";s:41:"default_value_widget][field_int][0][value";}}s:17:"default_value_php";N;}', + 'display_settings' => serialize(array( + 'weight' => 2, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'unformatted', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'us_0', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'unformatted', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example integer field.', + )) + ->values(array( + 'field_name' => 'field_test_three', + 'type_name' => 'story', + 'weight' => 3, + 'label' => 'Float Field', + 'widget_type' => 'number', + 'widget_settings' => serialize(array( + 'default_value' => array( + 0 => array( + 'value' => '101', + '_error_element' => 'default_value_widget][field_float][0][value', + ), + ), + 'default_value_php' => NULL, + )), + 'display_settings' => serialize(array( + 'weight' => 3, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'unformatted', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'us_2', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'unformatted', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example float field.', + )) + ->values(array( + 'field_name' => 'field_test_email', + 'type_name' => 'story', + 'weight' => 4, + 'label' => 'Email Field', + 'widget_type' => 'email_textfield', + 'widget_settings' => serialize(array( + 'size' => '60', + 'default_value' => array( + 0 => array( + 'email' => 'benjy@example.com', + ), + ), + 'default_value_php' => NULL, + )), + 'display_settings' => serialize(array( + 'weight' => 4, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'default', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example email field.', + )) + ->values(array( + 'field_name' => 'field_test_link', + 'type_name' => 'story', + 'weight' => 5, + 'label' => 'Link Field', + 'widget_type' => 'link', + 'widget_settings' => serialize(array( + 'default_value' => array( + 0 => array( + 'title' => 'default link title', + 'url' => 'http://drupal.org', + ), + ), + 'default_value_php' => NULL, + )), + 'display_settings' => serialize(array( + 'weight' => 5, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'absolute', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'default', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example link field.', + )) + ->values(array( + 'field_name' => 'field_test_filefield', + 'type_name' => 'story', + 'weight' => 7, + 'label' => 'File Field', + 'widget_type' => 'filefield_widget', + 'widget_settings' => serialize(array( + 'file_extensions' => 'txt pdf doc', + 'file_path' => 'images', + 'progress_indicator' => 'bar', + 'max_filesize_per_file' => '200K', + 'max_filesize_per_node' => '20M', + )), + 'display_settings' => serialize(array( + 'weight' => 7, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'url_plain', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'default', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example image field.', + )) + ->values(array( + 'field_name' => 'field_test_imagefield', + 'type_name' => 'story', + 'weight' => 8, + 'label' => 'Image Field', + 'widget_type' => 'imagefield_widget', + 'widget_settings' => serialize(array( + 'file_extensions' => 'png gif jpg jpeg', + 'file_path' => '', + 'progress_indicator' => 'bar', + 'max_filesize_per_file' => '', + 'max_filesize_per_node' => '', + 'max_resolution' => '0', + 'min_resolution' => '0', + 'alt' => 'Test alt', + 'custom_alt' => 0, + 'title' => 'Test title', + 'custom_title' => 0, + 'title_type' => 'textfield', + 'default_image' => NULL, + 'use_default_image' => 0, + )), + 'display_settings' => serialize(array( + 'weight' => 8, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'image_imagelink', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'image_plain', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'default', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example image field.', + )) + ->values(array( + 'field_name' => 'field_test_phone', + 'type_name' => 'story', + 'weight' => 9, + 'label' => 'Phone Field', + 'widget_type' => 'phone_textfield', + 'widget_settings' => serialize(array( + 'size' => '60', + 'default_value' => array( + 0 => array( + 'value' => '', + '_error_element' => 'default_value_widget][field_phone][0][value', + ), + ), + 'default_value_php' => NULL, + )), + 'display_settings' => serialize(array( + 'weight' => 9, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'default', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example phone field.', + )) + ->values(array( + 'field_name' => 'field_test_date', + 'type_name' => 'story', + 'weight' => 10, + 'label' => 'Date Field', + 'widget_type' => 'date_select', + 'widget_settings' => serialize(array( + 'default_value' => 'blank', + 'default_value_code' => '', + 'default_value2' => 'same', + 'default_value_code2' => '', + 'input_format' => 'm/d/Y - H:i:s', + 'input_format_custom' => '', + 'increment' => '1', + 'text_parts' => array(), + 'year_range' => '-3:+3', + 'label_position' => 'above', + )), + 'display_settings' => serialize(array( + 'weight' => 10, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'long', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'default', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example date field.', + )) + ->values(array( + 'field_name' => 'field_test_datestamp', + 'type_name' => 'story', + 'weight' => 11, + 'label' => 'Date Stamp Field', + 'widget_type' => 'date_select', + 'widget_settings' => serialize(array( + 'default_value' => 'blank', + 'default_value_code' => '', + 'default_value2' => 'same', + 'default_value_code2' => '', + 'input_format' => 'm/d/Y - H:i:s', + 'input_format_custom' => '', + 'increment' => '1', + 'text_parts' => array(), + 'year_range' => '-3:+3', + 'label_position' => 'above', + )), + 'display_settings' => serialize(array( + 'weight' => 11, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'medium', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'default', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example date stamp field.', + )) + ->values(array( + 'field_name' => 'field_test_datetime', + 'type_name' => 'story', + 'weight' => 12, + 'label' => 'Datetime Field', + 'widget_type' => 'date_select', + 'widget_settings' => serialize(array( + 'default_value' => 'blank', + 'default_value_code' => '', + 'default_value2' => 'same', + 'default_value_code2' => '', + 'input_format' => 'm/d/Y - H:i:s', + 'input_format_custom' => '', + 'increment' => '1', + 'text_parts' => array(), + 'year_range' => '-3:+3', + 'label_position' => 'above', + )), + 'display_settings' => serialize(array( + 'weight' => 12, + 'parent' => '', + 'label' => array( + 'format' => 'above', + ), + 'teaser' => array( + 'format' => 'short', + 'exclude' => 0, + ), + 'full' => array( + 'format' => 'default', + 'exclude' => 0, + ), + 4 => array( + 'format' => 'default', + 'exclude' => 0, + ), + 5 => array( + 'format' => 'default', + 'exclude' => 1, + ), + )), + 'description' => 'An example datetime field.', + )) + ->execute(); + + // Create the field table. + $this->createTable('content_node_field', array( + 'description' => 'Table that contains field instance settings.', + 'fields' => array( + 'field_name' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'type' => array( + 'type' => 'varchar', + 'length' => 127, + 'not null' => TRUE, + 'default' => '', + ), + 'global_settings' => array( + 'type' => 'text', + 'size' => 'medium', + 'not null' => TRUE, + 'serialize' => TRUE, + ), + 'required' => array( + 'type' => 'int', + 'size' => 'tiny', + 'not null' => TRUE, + 'default' => 0, + ), + 'multiple' => array( + 'type' => 'int', + 'size' => 'tiny', + 'not null' => TRUE, + 'default' => 0, + ), + 'db_storage' => array( + 'type' => 'int', + 'size' => 'tiny', + 'not null' => TRUE, + 'default' => 1, + ), + 'module' => array( + 'type' => 'varchar', + 'length' => 127, + 'not null' => TRUE, + 'default' => '', + ), + 'db_columns' => array( + 'type' => 'text', + 'size' => 'medium', + 'not null' => TRUE, + 'serialize' => TRUE, + ), + 'active' => array( + 'type' => 'int', + 'size' => 'tiny', + 'not null' => TRUE, + 'default' => 0, + ), + 'locked' => array( + 'type' => 'int', + 'size' => 'tiny', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'primary key' => array('field_name'), + )); + + $this->database->insert('content_node_field')->fields(array( + 'field_name', + 'module', + 'type', + 'global_settings', + 'multiple', + 'db_storage', + 'db_columns', + 'active', + )) + ->values(array( + 'field_name' => 'field_test', + 'module' => 'text', + 'type' => 'text', + 'global_settings' => 'a:4:{s:15:"text_processing";s:1:"1";s:10:"max_length";s:0:"";s:14:"allowed_values";s:0:"";s:18:"allowed_values_php";s:0:"";}', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => serialize(array( + 'value' => array( + 'type' => 'text', + 'size' => 'big', + 'not null' => FALSE, + 'sortable' => TRUE, + 'views' => TRUE, + ), + )), + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_two', + 'module' => 'number', + 'type' => 'number_integer', + 'global_settings' => 'a:6:{s:6:"prefix";s:4:"pref";s:6:"suffix";s:3:"suf";s:3:"min";i:10;s:3:"max";i:100;s:14:"allowed_values";s:0:"";s:18:"allowed_values_php";s:0:"";}', + 'multiple' => 1, + 'db_storage' => 0, + 'db_columns' => 'a:2:{s:5:"value";a:5:{s:4:"type";s:4:"text";s:4:"size";s:3:"big";s:8:"not null";b:0;s:8:"sortable";b:1;s:5:"views";b:1;}s:6:"format";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:0;s:5:"views";b:0;}}', + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_three', + 'module' => 'number', + 'type' => 'number_decimal', + 'global_settings' => '', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => 'a:0:{}', + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_email', + 'module' => 'email', + 'type' => 'email', + 'global_settings' => 'a:0:{}', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => 'a:0:{}', + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_link', + 'module' => 'link', + 'type' => 'link', + 'global_settings' => 'a:7:{s:10:"attributes";a:4:{s:6:"target";s:7:"default";s:3:"rel";s:8:"nofollow";s:5:"class";s:0:"";s:5:"title";s:10:"Link Title";}s:7:"display";a:1:{s:10:"url_cutoff";s:2:"80";}s:3:"url";i:0;s:5:"title";s:8:"required";s:11:"title_value";s:0:"";s:13:"enable_tokens";s:0:"";s:12:"validate_url";i:1;}', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => 'a:0:{}', + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_filefield', + 'module' => 'filefield', + 'type' => 'filefield', + 'global_settings' => 'a:3:{s:10:"list_field";s:1:"0";s:12:"list_default";i:1;s:17:"description_field";s:1:"1";}', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => 'a:0:{}', + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_imagefield', + 'module' => 'filefield', + 'type' => 'filefield', + 'global_settings' => 'a:3:{s:10:"list_field";s:1:"0";s:12:"list_default";i:1;s:17:"description_field";s:1:"0";}', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => 'a:0:{}', + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_phone', + 'module' => 'phone', + 'type' => 'au_phone', + 'global_settings' => 'a:1:{s:5:"value";a:3:{s:4:"type";s:7:"varchar";s:6:"length";i:255;s:8:"not null";b:0;}}', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => 'a:0:{}', + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_date', + 'module' => 'date', + 'type' => 'date', + 'global_settings' => 'a:0:{}', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => 'a:0:{}', + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_datestamp', + 'module' => 'date', + 'type' => 'datestamp', + 'global_settings' => 'a:0:{}', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => 'a:0:{}', + 'active' => 1, + )) + ->values(array( + 'field_name' => 'field_test_datetime', + 'module' => 'date', + 'type' => 'datetime', + 'global_settings' => 'a:0:{}', + 'multiple' => 0, + 'db_storage' => 1, + 'db_columns' => 'a:0:{}', + 'active' => 0, + )) + ->execute(); + + $this->createTable('content_field_test_two', array( + 'description' => 'Table for field_test_two', + 'fields' => array( + 'vid' => array( + 'description' => 'The primary identifier for this version.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'nid' => array( + 'description' => 'The {node} this version belongs to.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'field_test_two_value' => array( + 'description' => 'Test field column.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'delta' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'field_test_two_format' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'primary key' => array('vid', 'delta'), + )); + $this->database->insert('content_field_test_two')->fields(array( + 'vid', + 'nid', + 'field_test_two_value', + 'delta', + 'field_test_two_format', + )) + ->values(array( + 'vid' => 1, + 'nid' => 1, + 'field_test_two_value' => 10, + 'delta' => 0, + 'field_test_two_format' => 1, + )) + ->values(array( + 'vid' => 1, + 'nid' => 1, + 'field_test_two_value' => 20, + 'delta' => 1, + 'field_test_two_format' => 1, + )) + ->execute(); + $this->setModuleVersion('content', '6001'); + + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php new file mode 100644 index 0000000..23f0dc6 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6File.php @@ -0,0 +1,129 @@ +createTable('files', array( + 'fields' => array( + 'fid' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'uid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'filename' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'filepath' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'filemime' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'filesize' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'status' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'timestamp' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'uid' => array( + 'uid', + ), + 'status' => array( + 'status', + ), + 'timestamp' => array( + 'timestamp', + ), + ), + 'primary key' => array( + 'fid', + ), + 'module' => 'system', + 'name' => 'files', + )); + $this->database->insert('files')->fields(array( + 'fid', + 'uid', + 'filename', + 'filepath', + 'filemime', + 'filesize', + 'status', + 'timestamp', + )) + ->values(array( + 'fid' => '1', + 'uid' => '1', + 'filename' => 'Image1.png', + 'filepath' => 'core/modules/simpletest/files/image-1.png', + 'filemime' => 'image/png', + 'filesize' => '39325', + 'status' => '1', + 'timestamp' => '1388880660', + )) + ->values(array( + 'fid' => '2', + 'uid' => '1', + 'filename' => 'Image2.jpg', + 'filepath' => 'core/modules/simpletest/files/image-2.jpg', + 'filemime' => 'image/jpeg', + 'filesize' => '1831', + 'status' => '1', + 'timestamp' => '1388880664', + )) + ->values(array( + 'fid' => '3', + 'uid' => '1', + 'filename' => 'Image-test.gif', + 'filepath' => 'core/modules/simpletest/files/image-test.gif', + 'filemime' => 'image/jpeg', + 'filesize' => '183', + 'status' => '1', + 'timestamp' => '1388880668', + )) + ->execute(); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php new file mode 100644 index 0000000..01ef84d --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Menu.php @@ -0,0 +1,62 @@ +createTable('menu_custom', array( + 'fields' => array( + 'menu_name' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'title' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'description' => array( + 'type' => 'text', + 'not null' => FALSE, + ), + ), + 'primary key' => array( + 'menu_name', + ), + 'module' => 'menu', + 'name' => 'menu_custom', + )); + $this->database->insert('menu_custom')->fields(array('menu_name', 'title', 'description')) + ->values(array( + 'menu_name' => 'navigation', + 'title' => 'Navigation', + 'description' => 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.', + )) + ->values(array( + 'menu_name' => 'primary-links', + 'title' => 'Primary links', + 'description' => 'Primary links are often used at the theme layer to show the major sections of a site. A typical representation for primary links would be tabs along the top.', + )) + ->values(array( + 'menu_name' => 'secondary-links', + 'title' => 'Secondary links', + 'description' => 'Secondary links are often used for pages like legal notices, contact details, and other secondary navigation items that play a lesser role than primary links', + )) + ->execute(); + $this->setModuleVersion('menu', '6001'); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php new file mode 100644 index 0000000..cd31852 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Node.php @@ -0,0 +1,331 @@ +createTable('node', array( + 'description' => 'The base table for nodes.', + 'fields' => array( + 'nid' => array( + 'description' => 'The primary identifier for a node.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'vid' => array( + 'description' => 'The current {node_revisions}.vid version identifier.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'type' => array( + 'description' => 'The {node_type}.type of this node.', + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'language' => array( + 'description' => 'The {languages}.language of this node.', + 'type' => 'varchar', + 'length' => 12, + 'not null' => TRUE, + 'default' => '', + ), + 'title' => array( + 'description' => 'The title of this node, always treated as non-markup plain text.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'uid' => array( + 'description' => 'The {users}.uid that owns this node; initially, this is the user that created it.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'status' => array( + 'description' => 'Boolean indicating whether the node is published (visible to non-administrators).', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 1, + ), + 'created' => array( + 'description' => 'The Unix timestamp when the node was created.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'changed' => array( + 'description' => 'The Unix timestamp when the node was most recently saved.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'comment' => array( + 'description' => 'Whether comments are allowed on this node: 0 = no, 1 = read only, 2 = read/write.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'promote' => array( + 'description' => 'Boolean indicating whether the node should be displayed on the front page.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'moderate' => array( + 'description' => 'Previously, a boolean indicating whether the node was "in moderation"; mostly no longer used.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'sticky' => array( + 'description' => 'Boolean indicating whether the node should be displayed at the top of lists in which it appears.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'tnid' => array( + 'description' => 'The translation set id for this node, which equals the node id of the source post in each set.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'translate' => array( + 'description' => 'A boolean indicating whether this translation page needs to be updated.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'node_changed' => array('changed'), + 'node_created' => array('created'), + 'node_moderate' => array('moderate'), + 'node_promote_status' => array('promote', 'status'), + 'node_status_type' => array('status', 'type', 'nid'), + 'node_title_type' => array('title', array('type', 4)), + 'node_type' => array(array('type', 4)), + 'uid' => array('uid'), + 'tnid' => array('tnid'), + 'translate' => array('translate'), + ), + 'unique keys' => array( + 'vid' => array('vid'), + ), + 'primary key' => array('nid'), + )); + $this->database->insert('node')->fields(array( + 'nid', + 'vid', + 'type', + 'language', + 'title', + 'uid', + 'status', + 'created', + 'changed', + 'comment', + 'promote', + 'moderate', + 'sticky', + 'tnid', + 'translate', + )) + ->values(array( + 'nid' => 1, + 'vid' => 1, + 'type' => 'story', + 'language' => '', + 'title' => 'Test title', + 'uid' => 1, + 'status' => 1, + 'created' => 1388271197, + 'changed' => 1390095701, + 'comment' => 0, + 'promote' => 0, + 'moderate' => 0, + 'sticky' => 0, + 'tnid' => 0, + 'translate' => 0, + )) + ->values(array( + 'nid' => 2, + 'vid' => 3, + 'type' => 'story', + 'language' => '', + 'title' => 'Test title 2', + 'uid' => 1, + 'status' => 1, + 'created' => 1388271197, + 'changed' => 1390095701, + 'comment' => 0, + 'promote' => 0, + 'moderate' => 0, + 'sticky' => 0, + 'tnid' => 0, + 'translate' => 0, + )) + ->execute(); + $this->createTable('node_revisions', array( + 'description' => 'Stores information about each saved version of a {node}.', + 'fields' => array( + 'nid' => array( + 'description' => 'The {node} this version belongs to.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'vid' => array( + 'description' => 'The primary identifier for this version.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'uid' => array( + 'description' => 'The {users}.uid that created this version.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'title' => array( + 'description' => 'The title of this version.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'body' => array( + 'description' => 'The body of this version.', + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + ), + 'teaser' => array( + 'description' => 'The teaser of this version.', + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + ), + 'log' => array( + 'description' => 'The log entry explaining the changes in this version.', + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + ), + 'timestamp' => array( + 'description' => 'A Unix timestamp indicating when this version was created.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'format' => array( + 'description' => "The input format used by this version's body.", + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'nid' => array('nid'), + 'uid' => array('uid'), + ), + 'primary key' => array('vid'), + )); + + $this->database->insert('node_revisions')->fields( + array( + 'nid', + 'vid', + 'uid', + 'title', + 'body', + 'teaser', + 'log', + 'timestamp', + 'format', + )) + ->values(array( + 'nid' => 1, + 'vid' => 1, + 'uid' => 1, + 'title' => 'Test title', + 'body' => 'test', + 'teaser' => 'test', + 'log' => '', + 'timestamp' => 1390095701, + 'format' => 1, + )) + ->values(array( + 'nid' => 2, + 'vid' => 3, + 'uid' => 1, + 'title' => 'Test title rev 3', + 'body' => 'test rev 3', + 'teaser' => 'test rev 3', + 'log' => '', + 'timestamp' => 1390095701, + 'format' => 1, + )) + ->execute(); + + $this->createTable('content_type_story', array( + 'description' => 'The content type join table.', + 'fields' => array( + 'nid' => array( + 'description' => 'The {node} this version belongs to.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'vid' => array( + 'description' => 'The primary identifier for this version.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'field_test_value' => array( + 'description' => 'Test field column.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + ), + 'primary key' => array('vid'), + )); + + $this->database->insert('content_type_story')->fields( + array( + 'nid', + 'vid', + 'field_test_value', + )) + ->values(array( + 'nid' => 1, + 'vid' => 1, + 'field_test_value' => 'This is a text field', + )) + ->execute(); + $this->setModuleVersion('content', 6001); + } +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php new file mode 100644 index 0000000..8ec82b5 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeBodyInstance.php @@ -0,0 +1,102 @@ +createTable('variable'); + $this->createTable('node_type'); + $this->database->insert('node_type')->fields(array( + 'type', + 'name', + 'module', + 'description', + 'help', + 'has_title', + 'title_label', + 'has_body', + 'body_label', + 'min_word_count', + 'custom', + 'modified', + 'locked', + 'orig_type' + )) + ->values(array( + 'type' => 'company', + 'name' => 'Company', + 'module' => 'node', + 'description' => 'Company node type', + 'help' => '', + 'has_title' => 1, + 'title_label' => 'Name', + 'has_body' => 1, + 'body_label' => 'Description', + 'min_word_count' => 20, + 'custom' => 0, + 'modified' => 0, + 'locked' => 0, + 'orig_type' => 'company', + )) + ->values(array( + 'type' => 'employee', + 'name' => 'Employee', + 'module' => 'node', + 'description' => 'Employee node type', + 'help' => '', + 'has_title' => 1, + 'title_label' => 'Name', + 'has_body' => 1, + 'body_label' => 'Bio', + 'min_word_count' => 20, + 'custom' => 0, + 'modified' => 0, + 'locked' => 0, + 'orig_type' => 'employee', + )) + ->values(array( + 'type' => 'sponsor', + 'name' => 'Sponsor', + 'module' => 'node', + 'description' => 'Sponsor node type', + 'help' => '', + 'has_title' => 1, + 'title_label' => 'Name', + 'has_body' => 0, + 'body_label' => 'Body', + 'min_word_count' => 0, + 'custom' => 0, + 'modified' => 0, + 'locked' => 0, + 'orig_type' => '', + )) + ->execute(); + $this->database->insert('variable')->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => 'teaser_length', + 'value' => 'i:456;', + )) + ->values(array( + 'name' => 'node_preview', + 'value' => 'i:0;', + )) + ->execute(); + + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php new file mode 100644 index 0000000..04a4ad5 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeRevision.php @@ -0,0 +1,42 @@ +database->insert('node_revisions')->fields( + array( + 'nid', + 'vid', + 'uid', + 'title', + 'body', + 'teaser', + 'log', + 'timestamp', + 'format', + )) + ->values(array( + 'nid' => 1, + 'vid' => 2, + 'uid' => 1, + 'title' => 'Test title rev 2', + 'body' => 'test rev 2', + 'teaser' => 'test rev 2', + 'log' => '', + 'timestamp' => 1390095701, + 'format' => 1, + )) + ->execute(); + } +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php new file mode 100644 index 0000000..87db257 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6NodeType.php @@ -0,0 +1,136 @@ +createTable('node_type'); + $this->database->insert('node_type')->fields( + array( + 'type', + 'name', + 'module', + 'description', + 'help', + 'has_title', + 'title_label', + 'has_body', + 'body_label', + 'min_word_count', + 'custom', + 'modified', + 'locked', + 'orig_type', + )) + ->values(array( + 'type' => 'test_page', + 'name' => 'Migrate test page', + 'module' => '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' => '', + 'has_title' => 1, + 'title_label' => 'Title', + 'has_body' => 1, + 'body_label' => 'Body', + 'min_word_count' => 0, + 'custom' => 1, + 'modified' => 1, + 'locked' => 0, + 'orig_type' => 'page', + )) + ->values(array( + 'type' => 'test_story', + 'name' => 'Migrate test story', + 'module' => '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' => '', + 'has_title' => 1, + 'title_label' => 'Title', + 'has_body' => 0, + 'body_label' => 'Body', + 'min_word_count' => 0, + 'custom' => 1, + 'modified' => 1, + 'locked' => 0, + 'orig_type' => 'story', + )) + ->execute(); + + $this->database->merge('node_type') + ->key(array('type' => 'story')) + ->fields(array( + 'name' => 'Story', + 'module' => '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' => '', + 'has_title' => '1', + 'title_label' => 'Title', + 'has_body' => '1', + 'body_label' => 'Body', + 'min_word_count' => '0', + 'custom' => '1', + 'modified' => '1', + 'locked' => '0', + 'orig_type' => 'story', + )) + ->execute(); + + $this->createTable('variable'); + $this->database->insert('variable')->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => 'node_options_migrate_test_page', + 'value' => serialize(array( + 0 => 'status', + 1 => 'promote', + 2 => 'sticky', + )), + )) + ->values(array( + 'name' => 'node_options_migrate_test_story', + 'value' => serialize(array( + 0 => 'status', + 1 => 'promote', + )), + )) + ->values(array( + 'name' => 'theme_settings', + 'value' => serialize(array( + 'toggle_logo' => 1, + 'toggle_name' => 1, + 'toggle_slogan' => 0, + 'toggle_mission' => 1, + 'toggle_node_user_picture' => 0, + 'toggle_comment_user_picture' => 0, + 'toggle_search' => 0, + 'toggle_favicon' => 1, + 'toggle_primary_links' => 1, + 'toggle_secondary_links' => 1, + 'toggle_node_info_test' => 1, + 'toggle_node_info_something' => 1, + 'default_logo' => 1, + 'logo_path' => '', + 'logo_upload' => '', + 'default_favicon' => 1, + 'favicon_path' => '', + 'favicon_upload' => '', + 'toggle_node_info_migrate_test_page' => 1, + 'toggle_node_info_migrate_test_story' => 1, + )), + )) + ->execute(); + } +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php new file mode 100644 index 0000000..c0c7298 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6SearchPage.php @@ -0,0 +1,51 @@ +createTable('variable'); + $this->database->insert('variable')->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => 'node_rank_comments', + 'value' => 's:1:"5";', + )) + ->values(array( + 'name' => 'node_rank_promote', + 'value' => 's:1:"0";', + )) + ->values(array( + 'name' => 'node_rank_recent', + 'value' => 's:1:"0";', + )) + ->values(array( + 'name' => 'node_rank_relevance', + 'value' => 's:1:"2";', + )) + ->values(array( + 'name' => 'node_rank_sticky', + 'value' => 's:1:"8";', + )) + ->values(array( + 'name' => 'node_rank_views', + 'value' => 's:1:"1";', + )) + ->execute(); + + } +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php new file mode 100644 index 0000000..2f96140 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyTerm.php @@ -0,0 +1,182 @@ +setModuleVersion('taxonomy', 6000); + + $this->createTable('term_data', array( + 'fields' => array( + 'tid' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'vid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'name' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'description' => array( + 'type' => 'text', + 'not null' => FALSE, + 'size' => 'big', + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + ), + 'primary key' => array( + 'tid', + ), + 'indexes' => array( + 'taxonomy_tree' => array( + 'vid', + 'weight', + 'name', + ), + 'vid_name' => array( + 'vid', + 'name', + ), + ), + 'module' => 'taxonomy', + 'name' => 'term_data', + )); + + $this->createTable('term_hierarchy', array( + 'fields' => array( + 'tid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'parent' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'parent' => array( + 'parent', + ), + ), + 'primary key' => array( + 'tid', + 'parent', + ), + 'module' => 'taxonomy', + 'name' => 'term_hierarchy', + )); + + $this->database->insert('term_data')->fields(array( + 'tid', + 'vid', + 'name', + 'description', + 'weight', + )) + ->values(array( + 'tid' => '1', + 'vid' => '1', + 'name' => 'term 1 of vocabulary 1', + 'description' => 'description of term 1 of vocabulary 1', + 'weight' => '0', + )) + ->values(array( + 'tid' => '2', + 'vid' => '2', + 'name' => 'term 2 of vocabulary 2', + 'description' => 'description of term 2 of vocabulary 2', + 'weight' => '3', + )) + ->values(array( + 'tid' => '3', + 'vid' => '2', + 'name' => 'term 3 of vocabulary 2', + 'description' => 'description of term 3 of vocabulary 2', + 'weight' => '4', + )) + ->values(array( + 'tid' => '4', + 'vid' => '3', + 'name' => 'term 4 of vocabulary 3', + 'description' => 'description of term 4 of vocabulary 3', + 'weight' => '6', + )) + ->values(array( + 'tid' => '5', + 'vid' => '3', + 'name' => 'term 5 of vocabulary 3', + 'description' => 'description of term 5 of vocabulary 3', + 'weight' => '7', + )) + ->values(array( + 'tid' => '6', + 'vid' => '3', + 'name' => 'term 6 of vocabulary 3', + 'description' => 'description of term 6 of vocabulary 3', + 'weight' => '8', + )) + ->execute(); + + $this->database->insert('term_hierarchy')->fields(array( + 'tid', + 'parent', + )) + ->values(array( + 'tid' => '1', + 'parent' => '0', + )) + ->values(array( + 'tid' => '2', + 'parent' => '0', + )) + ->values(array( + 'tid' => '4', + 'parent' => '0', + )) + ->values(array( + 'tid' => '3', + 'parent' => '2', + )) + ->values(array( + 'tid' => '5', + 'parent' => '4', + )) + ->values(array( + 'tid' => '6', + 'parent' => '4', + )) + ->values(array( + 'tid' => '6', + 'parent' => '5', + )) + ->execute(); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php new file mode 100644 index 0000000..70b2429 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TaxonomyVocabulary.php @@ -0,0 +1,186 @@ +createTable('vocabulary', array( + 'description' => 'Stores vocabulary information.', + 'fields' => array( + 'vid' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'description' => 'Primary Key: Unique vocabulary ID.', + ), + 'name' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Name of the vocabulary.', + ), + 'description' => array( + 'type' => 'text', + 'not null' => FALSE, + 'size' => 'big', + 'description' => 'Description of the vocabulary.', + ), + 'help' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Help text to display for the vocabulary.', + ), + 'relations' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Whether or not related terms are enabled within the vocabulary. (0 = disabled, 1 = enabled)', + ), + 'hierarchy' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'The type of hierarchy allowed within the vocabulary. (0 = disabled, 1 = single, 2 = multiple)', + ), + 'multiple' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Whether or not multiple terms from this vocabulary may be assigned to a node. (0 = disabled, 1 = enabled)', + ), + 'required' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Whether or not terms are required for nodes using this vocabulary. (0 = disabled, 1 = enabled)', + ), + 'tags' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Whether or not free tagging is enabled for the vocabulary. (0 = disabled, 1 = enabled)', + ), + 'module' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'The module which created the vocabulary.', + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'The weight of the vocabulary in relation to other vocabularies.', + ), + ), + 'primary key' => array('vid'), + 'indexes' => array( + 'list' => array('weight', 'name'), + ), + )); + $this->createTable('vocabulary_node_types', array( + 'description' => 'Stores which node types vocabularies may be used with.', + 'fields' => array( + 'vid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Primary Key: the {vocabulary}.vid of the vocabulary.', + ), + 'type' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + 'description' => 'The {node}.type of the node type for which the vocabulary may be used.', + ), + ), + 'primary key' => array('type', 'vid'), + 'indexes' => array( + 'vid' => array('vid'), + ), + )); + $this->database->insert('vocabulary')->fields(array( + 'vid', + 'name', + 'description', + 'help', + 'relations', + 'hierarchy', + 'multiple', + 'required', + 'tags', + 'module', + 'weight', + )) + ->values(array( + 'vid' => '1', + 'name' => 'vocabulary 1 (i=0)', + 'description' => 'description of vocabulary 1 (i=0)', + 'help' => '', + 'relations' => '1', + 'hierarchy' => '0', + 'multiple' => '0', + 'required' => '0', + 'tags' => '0', + 'module' => 'taxonomy', + 'weight' => '4', + )) + ->values(array( + 'vid' => '2', + 'name' => 'vocabulary 2 (i=1)', + 'description' => 'description of vocabulary 2 (i=1)', + 'help' => '', + 'relations' => '1', + 'hierarchy' => '1', + 'multiple' => '1', + 'required' => '0', + 'tags' => '0', + 'module' => 'taxonomy', + 'weight' => '5', + )) + ->values(array( + 'vid' => '3', + 'name' => 'vocabulary 3 (i=2)', + 'description' => 'description of vocabulary 3 (i=2)', + 'help' => '', + 'relations' => '1', + 'hierarchy' => '2', + 'multiple' => '0', + 'required' => '0', + 'tags' => '0', + 'module' => 'taxonomy', + 'weight' => '6', + )) + ->execute(); + $this->setModuleVersion('taxonomy', 6001); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php new file mode 100644 index 0000000..8df32d7 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6TermNode.php @@ -0,0 +1,89 @@ +setModuleVersion('taxonomy', 6000); + $this->createTable('term_node', array( + 'fields' => array( + 'nid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'vid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'tid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'vid' => array( + 'vid', + ), + 'nid' => array( + 'nid', + ), + ), + 'primary key' => array( + 'tid', + 'vid', + ), + 'module' => 'taxonomy', + 'name' => 'term_node', + )); + $this->database->insert('term_node')->fields(array( + 'nid', + 'vid', + 'tid', + )) + ->values(array( + 'nid' => 1, + 'vid' => 1, + 'tid' => 1, + )) + ->values(array( + 'nid' => 1, + 'vid' => 2, + 'tid' => 5, + )) + ->values(array( + 'nid' => 1, + 'vid' => 2, + 'tid' => 4, + )) + ->values(array( + 'nid' => 2, + 'vid' => 3, + 'tid' => 2, + )) + ->values(array( + 'nid' => 2, + 'vid' => 3, + 'tid' => 3, + )) + ->execute(); + + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php new file mode 100644 index 0000000..6fd53d3 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6Upload.php @@ -0,0 +1,120 @@ +setModuleVersion('upload', 6000); + $this->createTable('upload', array( + 'fields' => array( + 'fid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Primary Key: The {files}.fid.', + ), + 'nid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {node}.nid associated with the uploaded file.', + ), + 'vid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Primary Key: The {node}.vid associated with the uploaded file.', + ), + 'description' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Description of the uploaded file.', + ), + 'list' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Whether the file should be visibly listed on the node: yes(1) or no(0).', + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Weight of this upload in relation to other uploads in this node.', + ), + ), + 'primary key' => array('vid', 'fid'), + 'indexes' => array( + 'fid' => array('fid'), + 'nid' => array('nid'), + ), + )); + $this->database->insert('upload')->fields(array( + 'nid', + 'vid', + 'fid', + 'description', + 'list', + 'weight', + )) + ->values(array( + 'nid' => 1, + 'vid' => 1, + 'fid' => 1, + 'description' => 'file 1-1-1', + 'list' => 0, + 'weight' => 5, + )) + ->values(array( + 'nid' => 1, + 'vid' => 2, + 'fid' => 2, + 'description' => 'file 1-2-2', + 'list' => 1, + 'weight' => 4, + )) + ->values(array( + 'nid' => 1, + 'vid' => 2, + 'fid' => 3, + 'description' => 'file 1-2-3', + 'list' => 0, + 'weight' => 3, + )) + ->values(array( + 'nid' => 2, + 'vid' => 3, + 'fid' => 2, + 'description' => 'file 2-3-2', + 'list' => 1, + 'weight' => 2, + )) + ->values(array( + 'nid' => 2, + 'vid' => 3, + 'fid' => 3, + 'description' => 'file 2-3-3', + 'list' => 0, + 'weight' => 1, + )) + ->execute(); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadField.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadField.php new file mode 100644 index 0000000..6df410d --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadField.php @@ -0,0 +1,19 @@ +setModuleVersion('upload', 6000); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php new file mode 100644 index 0000000..c3721ba --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UploadInstance.php @@ -0,0 +1,95 @@ +setModuleVersion('upload', 6000); + $this->createTable('node_type'); + $this->database->merge('node_type') + ->key(array('type' => 'page')) + ->fields(array( + 'name' => 'Page', + 'module' => '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' => '', + 'has_title' => '1', + 'title_label' => 'Title', + 'has_body' => '1', + 'body_label' => 'Body', + 'min_word_count' => '0', + 'custom' => '1', + 'modified' => '1', + 'locked' => '0', + 'orig_type' => 'page', + )) + ->execute(); + $this->database->merge('node_type') + ->key(array('type' => 'story')) + ->fields(array( + 'name' => 'Story', + 'module' => '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' => '', + 'has_title' => '1', + 'title_label' => 'Title', + 'has_body' => '1', + 'body_label' => 'Body', + 'min_word_count' => '0', + 'custom' => '1', + 'modified' => '1', + 'locked' => '0', + 'orig_type' => 'story', + )) + ->execute(); + $this->database->merge('node_type') + ->key(array('type' => 'article')) + ->fields(array( + 'name' => 'Article', + 'module' => 'node', + 'description' => "An article, content type.", + 'help' => '', + 'has_title' => '1', + 'title_label' => 'Title', + 'has_body' => '1', + 'body_label' => 'Body', + 'min_word_count' => '0', + 'custom' => '1', + 'modified' => '1', + 'locked' => '0', + 'orig_type' => 'story', + )) + ->execute(); + $this->createTable('variable'); + $this->database->insert('variable')->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => 'upload_page', + 'value' => 'b:1;', + )) + ->values(array( + 'name' => 'upload_story', + 'value' => 'b:1;', + )) + ->values(array( + 'name' => 'upload_article', + 'value' => 'b:0;', + )) + ->execute(); + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php new file mode 100644 index 0000000..2af66ef --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UrlAlias.php @@ -0,0 +1,82 @@ +createTable('url_alias', array( + 'description' => 'A list of URL aliases for Drupal paths; a user may visit either the source or destination path.', + 'fields' => array( + 'pid' => array( + 'description' => 'A unique path alias identifier.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'src' => array( + 'description' => 'The Drupal path this alias is for; e.g. node/12.', + 'type' => 'varchar', + 'length' => 128, + 'not null' => TRUE, + 'default' => '', + ), + 'dst' => array( + 'description' => 'The alias for this path; e.g. title-of-the-story.', + 'type' => 'varchar', + 'length' => 128, + 'not null' => TRUE, + 'default' => '', + ), + 'language' => array( + 'description' => 'The language this alias is for; if blank, the alias will be used for unknown languages. Each Drupal path can have an alias for each supported language.', + 'type' => 'varchar', + 'length' => 12, + 'not null' => TRUE, + 'default' => '', + ), + ), + 'unique keys' => array( + 'dst_language_pid' => array( + 'dst', + 'language', + 'pid', + ), + ), + 'primary key' => array('pid'), + 'indexes' => array('src_language_pid' => array('src', 'language', 'pid')), + )); + + $this->database->insert('url_alias')->fields(array( + 'pid', + 'src', + 'dst', + 'language', + )) + ->values(array( + 'pid' => 1, + 'src' => 'node/1', + 'dst' => 'alias-one', + 'language' => 'en', + )) + ->values(array( + 'pid' => 2, + 'src' => 'node/2', + 'dst' => 'alias-two', + 'language' => 'en', + )) + ->execute(); + + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php new file mode 100644 index 0000000..2b662e8 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6User.php @@ -0,0 +1,423 @@ + $schema) { + // Create tables. + $this->createTable($table, $schema); + + // Insert data. + $data = static::getData($table); + if ($data) { + $query = $this->database->insert($table)->fields(array_keys($data[0])); + foreach ($data as $record) { + $query->values($record); + } + $query->execute(); + } + } + } + + /** + * Defines schema for this database dump. + * + * @return array + * Associative array having the structure as is returned by hook_schema(). + */ + protected static function getSchema() { + return array( + 'users' => array( + 'description' => 'Stores user data.', + 'fields' => array( + 'uid' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'description' => 'Primary Key: Unique user ID.', + ), + 'name' => array( + 'type' => 'varchar', + 'length' => 60, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Unique user name.', + ), + 'pass' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + 'description' => "User's password (md5 hash).", + ), + 'mail' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => FALSE, + 'default' => '', + 'description' => "User's email address.", + ), + 'mode' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Per-user comment display mode (threaded vs. flat), used by the {comment} module.', + ), + 'sort' => array( + 'type' => 'int', + 'not null' => FALSE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Per-user comment sort order (newest vs. oldest first), used by the {comment} module.', + ), + 'threshold' => array( + 'type' => 'int', + 'not null' => FALSE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Previously used by the {comment} module for per-user preferences; no longer used.', + ), + 'theme' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => "User's default theme.", + ), + 'signature' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => "User's signature.", + ), + 'signature_format' => array( + 'type' => 'int', + 'size' => 'small', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {filter_formats}.format of the signature.', + ), + 'created' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Timestamp for when user was created.', + ), + 'access' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Timestamp for previous time user accessed the site.', + ), + 'login' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => "Timestamp for user's last login.", + ), + 'status' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + 'description' => 'Whether the user is active(1) or blocked(0).', + ), + 'timezone' => array( + 'type' => 'varchar', + 'length' => 8, + 'not null' => FALSE, + 'description' => "User's timezone.", + ), + 'language' => array( + 'type' => 'varchar', + 'length' => 12, + 'not null' => TRUE, + 'default' => '', + 'description' => "User's default language.", + ), + 'picture' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => "Path to the user's uploaded picture.", + ), + 'init' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => FALSE, + 'default' => '', + 'description' => 'Email address used for initial account creation.', + ), + 'data' => array( + 'type' => 'text', + 'not null' => FALSE, + 'size' => 'big', + 'description' => 'A serialized array of name value pairs that are related to the user. Any form values posted during user edit are stored and are loaded into the $user object during user_load(). Use of this field is discouraged and it will likely disappear in a future version of Drupal.', + ), + // Field not part of Drupal 6 schema. Added by Date contributed module. + 'timezone_name' => array( + 'type' => 'varchar', + 'length' => 50, + 'not null' => FALSE, + 'default' => '', + 'description' => 'Field added by Date contributed module.', + ), + // Field not part of Drupal 6 schema. Added by Event contributed module. + 'timezone_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Field added by Event contributed module.', + ), + // Field not part of Drupal 6 schema. Needed to test password rehashing. + 'pass_plain' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => "User's password (plain).", + ), + // Field not part of Drupal 6 schema. Needed to test user_update_7002. + 'expected_timezone' => array( + 'type' => 'varchar', + 'length' => 50, + 'not null' => FALSE, + ), + ), + 'indexes' => array( + 'access' => array('access'), + 'created' => array('created'), + 'mail' => array('mail'), + ), + 'unique keys' => array( + 'name' => array('name'), + ), + 'primary key' => array('uid'), + ), + 'users_roles' => array( + 'description' => 'Maps users to roles.', + 'fields' => array( + 'uid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Primary Key: {users}.uid for user.', + ), + 'rid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Primary Key: {role}.rid for role.', + ), + ), + 'primary key' => array('uid', 'rid'), + 'indexes' => array( + 'rid' => array('rid'), + ), + ), + 'event_timezones' => array( + 'fields' => array( + 'timezone' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'name' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + ) + ), + 'profile_values' => array( + 'description' => 'Stores values for profile fields.', + 'fields' => array( + 'fid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {profile_field}.fid of the field.', + ), + 'uid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {users}.uid of the profile user.', + ), + 'value' => array( + 'type' => 'text', + 'not null' => FALSE, + 'description' => 'The value for the field.', + ), + ), + 'primary key' => array('uid', 'fid'), + 'indexes' => array( + 'fid' => array('fid'), + ), + 'foreign keys' => array( + 'profile_field' => array( + 'table' => 'profile_field', + 'columns' => array('fid' => 'fid'), + ), + 'profile_user' => array( + 'table' => 'users', + 'columns' => array('uid' => 'uid'), + ), + ), + ), + ); + } + + /** + * Returns dump data from a specific table. + * + * @param string $table + * The table name. + * + * @return array + * Array of associative arrays each one having fields as keys. + */ + public static function getData($table) { + $data = array( + 'users' => array( + array( + 'uid' => 2, + 'name' => 'john.doe', + 'pass' => md5('john.doe_pass'), + 'mail' => 'john.doe@example.com', + 'picture' => 'core/modules/simpletest/files/image-test.jpg', + 'mode' => 0, + 'sort' => 0, + 'threshold' => 0, + 'theme' => '', + 'signature' => 'John Doe | john.doe@example.com', + 'signature_format' => 1, + 'created' => 1391150052, + 'access' => 1391259672, + 'login' => 1391152253, + 'status' => 1, + 'timezone' => '3600', + 'language' => 'fr', + 'init' => 'doe@example.com', + 'data' => serialize(array()), + 'timezone_name' => NULL, + 'timezone_id' => 1, + 'pass_plain' => 'john.doe_pass', + 'expected_timezone' => 'Europe/Berlin', + ), + array( + 'uid' => 8, + 'name' => 'joe.roe', + 'pass' => md5('joe.roe_pass'), + 'mail' => 'joe.roe@example.com', + 'picture' => 'core/modules/simpletest/files/image-test.png', + 'mode' => 0, + 'sort' => 0, + 'threshold' => 0, + 'theme' => '', + 'signature' => 'JR', + 'signature_format' => 2, + 'created' => 1391150053, + 'access' => 1391259673, + 'login' => 1391152254, + 'status' => 1, + 'timezone' => '7200', + 'language' => 'ro', + 'init' => 'roe@example.com', + 'data' => serialize(array()), + 'timezone_name' => 'Europe/Helsinki', + 'timezone_id' => 0, + 'pass_plain' => 'joe.roe_pass', + 'expected_timezone' => 'Europe/Helsinki', + ), + array( + 'uid' => 15, + 'name' => 'joe.bloggs', + 'pass' => md5('joe.bloggs_pass'), + 'mail' => 'joe.bloggs@example.com', + 'picture' => '', + 'mode' => 0, + 'sort' => 0, + 'threshold' => 0, + 'theme' => '', + 'signature' => 'bloggs', + 'signature_format' => 1, + 'created' => 1391150054, + 'access' => 1391259674, + 'login' => 1391152255, + 'status' => 1, + 'timezone' => '3600', + 'language' => 'en', + 'init' => 'bloggs@example.com', + 'data' => serialize(array()), + 'timezone_name' => NULL, + 'timezone_id' => 0, + 'pass_plain' => 'joe.bloggs_pass', + 'expected_timezone' => NULL, + ), + ), + 'users_roles' => array( + array('uid' => 2, 'rid' => 3), + array('uid' => 8, 'rid' => 4), + array('uid' => 8, 'rid' => 5), + array('uid' => 15, 'rid' => 3), + array('uid' => 15, 'rid' => 4), + array('uid' => 15, 'rid' => 5), + ), + 'event_timezones' => array( + array( + 'timezone' => 1, + 'name' => 'Europe/Berlin', + ) + ), + 'profile_values' => array( + array('fid' => 8, 'uid' => 2, 'value' => 'red'), + array('fid' => 9, 'uid' => 2, 'value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nulla sapien, congue nec risus ut, adipiscing aliquet felis. Maecenas quis justo vel nulla varius euismod. Quisque metus metus, cursus sit amet sem non, bibendum vehicula elit. Cras dui nisl, eleifend at iaculis vitae, lacinia ut felis. Nullam aliquam ligula volutpat nulla consectetur accumsan. Maecenas tincidunt molestie diam, a accumsan enim fringilla sit amet. Morbi a tincidunt tellus. Donec imperdiet scelerisque porta. Sed quis sem bibendum eros congue sodales. Vivamus vel fermentum est, at rutrum orci. Nunc consectetur purus ut dolor pulvinar, ut volutpat felis congue. Cras tincidunt odio sed neque sollicitudin, vehicula tempor metus scelerisque.'), + array('fid' => 10, 'uid' => 2, 'value' => '1'), + array('fid' => 11, 'uid' => 2, 'value' => 'Fitness spammers'), + array('fid' => 12, 'uid' => 2, 'value' => "AC/DC\nEagles"), + array('fid' => 13, 'uid' => 2, 'value' => "http://example.com/blog"), + array('fid' => 14, 'uid' => 2, 'value' => 'a:3:{s:5:"month";s:1:"6";s:3:"day";s:1:"2";s:4:"year";s:4:"1974";}'), + array('fid' => 8, 'uid' => 8, 'value' => 'brown'), + array('fid' => 9, 'uid' => 8, 'value' => 'Nunc condimentum ligula felis, eget lacinia purus accumsan at. Pellentesque eu lobortis felis. Duis at accumsan nisl, vel pulvinar risus. Nullam venenatis, tellus non eleifend hendrerit, augue nulla rhoncus leo, eget convallis enim sem ut velit. Mauris tincidunt enim ut eros volutpat dapibus. Curabitur augue libero, imperdiet eget orci sed, malesuada dapibus tellus. Nam lacus sapien, convallis vitae quam vel, bibendum commodo odio.'), + array('fid' => 10, 'uid' => 8, 'value' => '0'), + array('fid' => 11, 'uid' => 8, 'value' => ''), + array('fid' => 12, 'uid' => 8, 'value' => "Deep Purple\nWho\nThe Beatles"), + array('fid' => 13, 'uid' => 8, 'value' => "http://blog.example.com"), + array('fid' => 14, 'uid' => 8, 'value' => 'a:3:{s:5:"month";s:1:"9";s:3:"day";s:1:"9";s:4:"year";s:4:"1980";}'), + array('fid' => 8, 'uid' => 15, 'value' => 'orange'), + array('fid' => 9, 'uid' => 15, 'value' => 'Donec a diam volutpat augue fringilla fringilla. Mauris ultricies turpis ut lacus tempus, vitae pharetra lacus mattis. Nulla semper dui euismod sem bibendum, in eleifend nisi malesuada. Vivamus orci mauris, volutpat vitae enim ac, aliquam tempus lectus.'), + array('fid' => 10, 'uid' => 15, 'value' => '1'), + array('fid' => 11, 'uid' => 15, 'value' => 'Pill spammers'), + array('fid' => 12, 'uid' => 15, 'value' => "ABBA\nBoney M"), + array('fid' => 13, 'uid' => 15, 'value' => "http://example.com/journal"), + array('fid' => 14, 'uid' => 15, 'value' => 'a:3:{s:5:"month";s:2:"11";s:3:"day";s:2:"25";s:4:"year";s:4:"1982";}'), + ), + ); + + return isset($data[$table]) ? $data[$table] : FALSE; + } + +} diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php new file mode 100644 index 0000000..60e90df --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6UserProfileFields.php @@ -0,0 +1,245 @@ +createTable('profile_fields', array( + 'fields' => array( + 'fid' => array( + 'type' => 'serial', + 'not null' => TRUE, + ), + 'title' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + ), + 'name' => array( + 'type' => 'varchar', + 'length' => 128, + 'not null' => TRUE, + 'default' => '', + ), + 'explanation' => array( + 'type' => 'text', + 'not null' => FALSE, + ), + 'category' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + ), + 'page' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + ), + 'type' => array( + 'type' => 'varchar', + 'length' => 128, + 'not null' => FALSE, + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'required' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'register' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'visibility' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'autocomplete' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'options' => array( + 'type' => 'text', + 'not null' => FALSE, + ), + ), + 'indexes' => array( + 'category' => array( + 'category', + ), + ), + 'unique keys' => array( + 'name' => array( + 'name', + ), + ), + 'primary key' => array( + 'fid', + ), + 'module' => 'profile', + 'name' => 'profile_fields', + )); + + // Insert data. + $data = static::getData('profile_fields'); + if ($data) { + $query = $this->database->insert('profile_fields')->fields(array_keys($data[0])); + foreach ($data as $record) { + $query->values($record); + } + $query->execute(); + } + $this->setModuleVersion('profile', 6001); + } + + /** + * Returns dump data from a specific table. + * + * @param string $table + * The table name. + * + * @return array + * Array of associative arrays each one having fields as keys. + */ + public static function getData($table) { + $data = array( + 'profile_fields' => array( + array( + 'fid' => '8', + 'title' => 'Favorite color', + 'name' => 'profile_color', + 'explanation' => 'List your favorite color', + 'category' => 'Personal information', + 'page' => 'Peole whose favorite color is %value', + 'type' => 'textfield', + 'weight' => '-10', + 'required' => '0', + 'register' => '1', + 'visibility' => '2', + 'autocomplete' => '1', + 'options' => '', + ), + array( + 'fid' => '9', + 'title' => 'Biography', + 'name' => 'profile_biography', + 'explanation' => 'Tell people a little bit about yourself', + 'category' => 'Personal information', + 'page' => '', + 'type' => 'textarea', + 'weight' => '-8', + 'required' => '0', + 'register' => '0', + 'visibility' => '2', + 'autocomplete' => '0', + 'options' => '', + ), + array( + 'fid' => '10', + 'title' => 'Sell your e-mail address?', + 'name' => 'profile_sell_address', + 'explanation' => "If you check this box, we'll sell your address to spammers to help line the pockets of our shareholders. Thanks!", + 'category' => 'Communication preferences', + 'page' => 'People who want us to sell their address', + 'type' => 'checkbox', + 'weight' => '-10', + 'required' => '0', + 'register' => '1', + 'visibility' => '1', + 'autocomplete' => '0', + 'options' => '', + ), + array( + 'fid' => '11', + 'title' => 'Sales Category', + 'name' => 'profile_sold_to', + 'explanation' => "Select the sales categories to which this user's address was sold.", + 'category' => 'Administrative data', + 'page' => 'People whose address was sold to %value', + 'type' => 'selection', + 'weight' => '-10', + 'required' => '0', + 'register' => '0', + 'visibility' => '4', + 'autocomplete' => '0', + 'options' => "Pill spammers\r\nFitness spammers", + ), + array( + 'fid' => '12', + 'title' => 'Favorite bands', + 'name' => 'profile_bands', + 'explanation' => "Enter your favorite bands. When you've saved your profile, you'll be able to find other people with the same favorites.", + 'category' => 'Personal information', + 'page' => '', + 'type' => 'list', + 'weight' => '-6', + 'required' => '0', + 'register' => '1', + 'visibility' => '3', + 'autocomplete' => '1', + 'options' => '', + ), +/* + array( + 'fid' => '13', + 'title' => 'Your blog', + 'name' => 'profile_blog', + 'explanation' => 'Paste the full URL, including http://, of your personal blog.', + 'category' => 'Personal information', + 'page' => '', + 'type' => 'url', + 'weight' => '0', + 'required' => '0', + 'register' => '0', + 'visibility' => '2', + 'autocomplete' => '0', + 'options' => '', + ), +*/ + array( + 'fid' => '14', + 'title' => 'Birthdate', + 'name' => 'profile_birthdate', + 'explanation' => "Enter your birth date and we'll send you a coupon.", + 'category' => 'Personal information', + 'page' => '', + 'type' => 'date', + 'weight' => '4', + 'required' => '0', + 'register' => '0', + 'visibility' => '2', + 'autocomplete' => '0', + 'options' => '', + ), + ), + ); + + return isset($data[$table]) ? $data[$table] : FALSE; + } + +} + diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php new file mode 100644 index 0000000..1330cb5 --- /dev/null +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/Dump/Drupal6VocabularyField.php @@ -0,0 +1,173 @@ +createTable('vocabulary', array( + 'fields' => array( + 'vid' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'name' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'description' => array( + 'type' => 'text', + 'not null' => FALSE, + 'size' => 'big', + ), + 'help' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'relations' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'hierarchy' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'multiple' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'required' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'tags' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + 'module' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'weight' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ), + ), + 'primary key' => array( + 'vid', + ), + 'indexes' => array( + 'list' => array( + 'weight', + 'name', + ), + ), + 'module' => 'taxonomy', + 'name' => 'vocabulary', + )); + + $this->database->insert('vocabulary') + ->fields(array( + 'vid' => 4, + 'name' => 'Tags', + 'description' => 'Tags Vocabulary', + 'help' => '', + 'relations' => '1', + 'hierarchy' => '0', + 'multiple' => '0', + 'required' => '0', + 'tags' => '0', + 'module' => 'taxonomy', + 'weight' => '0', + )) + ->execute(); + + + $this->createTable('vocabulary_node_types', array( + 'description' => 'Stores which node types vocabularies may be used with.', + 'fields' => array( + 'vid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Primary Key: the {vocabulary}.vid of the vocabulary.', + ), + 'type' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + 'description' => 'The {node}.type of the node type for which the vocabulary may be used.', + ), + ), + 'primary key' => array('type', 'vid'), + 'indexes' => array( + 'vid' => array('vid'), + ), + )); + + $this->database->insert('vocabulary_node_types')->fields(array( + 'vid', + 'type', + )) + ->values(array( + 'vid' => '1', + 'type' => 'story', + )) + ->values(array( + 'vid' => '2', + 'type' => 'story', + )) + ->values(array( + 'vid' => '3', + 'type' => 'story', + )) + ->values(array( + 'vid' => '4', + 'type' => 'article', + )) + ->values(array( + 'vid' => '4', + 'type' => 'page', + )) + ->execute(); + $this->setModuleVersion('taxonomy', 6001); + } + +}