Mercurial > hg > isophonics-drupal-site
annotate core/modules/contact/tests/drupal-7.contact.database.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | af1871eacc83 |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 /** |
Chris@0 | 4 * @file |
Chris@0 | 5 * Database additions for Drupal\contact\Tests\ContactUpgradePathTest. |
Chris@0 | 6 * |
Chris@0 | 7 * This dump only contains data for the contact module. The |
Chris@0 | 8 * drupal-7.filled.bare.php file is imported before this dump, so the two form |
Chris@0 | 9 * the database structure expected in tests altogether. |
Chris@0 | 10 */ |
Chris@0 | 11 |
Chris@18 | 12 $connection = \Drupal::database(); |
Chris@0 | 13 // Update the default category to that it is not selected. |
Chris@18 | 14 $connection->update('contact') |
Chris@0 | 15 ->fields(['selected' => '0']) |
Chris@0 | 16 ->condition('cid', '1') |
Chris@0 | 17 ->execute(); |
Chris@0 | 18 |
Chris@0 | 19 // Add a custom contact category. |
Chris@18 | 20 $connection->insert('contact')->fields([ |
Chris@0 | 21 'category', |
Chris@0 | 22 'recipients', |
Chris@0 | 23 'reply', |
Chris@0 | 24 'weight', |
Chris@17 | 25 'selected', |
Chris@0 | 26 ]) |
Chris@0 | 27 ->values([ |
Chris@0 | 28 'category' => 'Upgrade test', |
Chris@0 | 29 'recipients' => 'test1@example.com,test2@example.com', |
Chris@0 | 30 'reply' => 'Test reply', |
Chris@0 | 31 'weight' => 1, |
Chris@0 | 32 'selected' => 1, |
Chris@0 | 33 ]) |
Chris@0 | 34 ->execute(); |