drupal-7.contact.database.php 821 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @file
  4. * Database additions for Drupal\contact\Tests\ContactUpgradePathTest.
  5. *
  6. * This dump only contains data for the contact module. The
  7. * drupal-7.filled.bare.php file is imported before this dump, so the two form
  8. * the database structure expected in tests altogether.
  9. */
  10. $connection = \Drupal::database();
  11. // Update the default category to that it is not selected.
  12. $connection->update('contact')
  13. ->fields(['selected' => '0'])
  14. ->condition('cid', '1')
  15. ->execute();
  16. // Add a custom contact category.
  17. $connection->insert('contact')->fields([
  18. 'category',
  19. 'recipients',
  20. 'reply',
  21. 'weight',
  22. 'selected',
  23. ])
  24. ->values([
  25. 'category' => 'Upgrade test',
  26. 'recipients' => 'test1@example.com,test2@example.com',
  27. 'reply' => 'Test reply',
  28. 'weight' => 1,
  29. 'selected' => 1,
  30. ])
  31. ->execute();