annotate core/modules/contact/tests/drupal-7.contact.database.php @ 5:12f9dff5fda9
tip
Update to Drupal core 8.7.1
author |
Chris Cannam |
date |
Thu, 09 May 2019 15:34:47 +0100 |
parents |
a9cd425dd02b |
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@5
|
12 $connection = \Drupal::database();
|
Chris@0
|
13 // Update the default category to that it is not selected.
|
Chris@5
|
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@5
|
20 $connection->insert('contact')->fields([
|
Chris@0
|
21 'category',
|
Chris@0
|
22 'recipients',
|
Chris@0
|
23 'reply',
|
Chris@0
|
24 'weight',
|
Chris@4
|
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();
|