diff core/modules/contact/tests/drupal-7.contact.database.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children a9cd425dd02b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/contact/tests/drupal-7.contact.database.php	Thu Jul 05 14:24:15 2018 +0000
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * @file
+ * Database additions for Drupal\contact\Tests\ContactUpgradePathTest.
+ *
+ * This dump only contains data for the contact module. The
+ * drupal-7.filled.bare.php file is imported before this dump, so the two form
+ * the database structure expected in tests altogether.
+ */
+
+// Update the default category to that it is not selected.
+db_update('contact')
+  ->fields(['selected' => '0'])
+  ->condition('cid', '1')
+  ->execute();
+
+// Add a custom contact category.
+db_insert('contact')->fields([
+  'category',
+  'recipients',
+  'reply',
+  'weight',
+  'selected'
+])
+  ->values([
+  'category' => 'Upgrade test',
+  'recipients' => 'test1@example.com,test2@example.com',
+  'reply' => 'Test reply',
+  'weight' => 1,
+  'selected' => 1,
+])
+  ->execute();