drupal-7.system.database.php 6.42 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php

/**
 * @file
 * Database additions for system tests. Used in upgrade.system.test.
 *
 * This dump only contains data and schema components relevant for system
 * functionality. The drupal-7.filled.bare.php file is imported before
 * this dump, so the two form the database structure expected in tests
 * altogether.
 */

// Add non-default system settings.
db_insert('variable')->fields(array(
15 16 17 18 19 20 21 22
    'name',
    'value',
  ))
  ->values(array(
    'name' => 'cache',
    'value'=> 'i:1;',
  ))
  ->values(array(
23 24 25
    'name' => 'cache_lifetime',
    'value' => 's:5:"10800";',
  ))
26
  ->values(array(
27 28 29
    'name' => 'page_cache_maximum_age',
    'value' => 's:4:"1800";',
  ))
30
  ->values(array(
31 32 33
    'name' => 'page_compression',
    'value' => 'i:1;',
  ))
34
  ->values(array(
35 36 37
    'name' => 'preprocess_css',
    'value' => 'i:1;',
  ))
38
  ->values(array(
39 40 41
    'name' => 'preprocess_js',
    'value' => 'i:1;',
  ))
42
  ->values(array(
43 44 45
    'name' => 'cron_safe_threshold',
    'value' => 's:5:"86400";',
  ))
46
  ->values(array(
47 48 49
    'name' => 'cron_threshold_warning',
    'value' => 's:5:"86400";',
  ))
50
  ->values(array(
51 52 53
    'name' => 'cron_threshold_error',
    'value' => 's:6:"172800";',
  ))
54
  ->values(array(
55 56 57
    'name' => 'error_level',
    'value' => 's:1:"1";',
  ))
58
  ->values(array(
59 60 61
    'name' => 'maintenance_mode',
    'value' => 'i:1;',
  ))
62
  ->values(array(
63 64 65
    'name' => 'maintenance_mode_message',
    'value' => 's:22:"Testing config upgrade"',
  ))
66
  ->values(array(
67 68 69
    'name' => 'feed_default_items',
    'value' => 's:2:"20";',
  ))
70
  ->values(array(
71 72 73
    'name' => 'feed_description',
    'value' => 's:22:"Testing config upgrade";',
  ))
74
  ->values(array(
75 76 77
    'name' => 'feed_item_length',
    'value' => 's:6:"teaser";',
  ))
78
  ->values(array(
79 80 81
    'name' => 'site_403',
    'value' => 's:3:"403";',
  ))
82
  ->values(array(
83 84 85
    'name' => 'site_404',
    'value' => 's:3:"404";',
  ))
86
  ->values(array(
87 88 89
    'name' => 'site_frontpage',
    'value' => 's:4:"node";',
  ))
90
  ->values(array(
91 92 93
    'name' => 'site_slogan',
    'value' => 's:31:"CMI makes Drupal 8 drush cex -y";',
  ))
94 95 96
  ->values(array(
    'name' => 'user_cancel_method',
    'value' => 's:20:"user_cancel_reassign"',
97
  ))
98
  ->values(array(
99 100 101
    'name' => 'taxonomy_override_selector',
    'value' => 'i:1;',
  ))
102
  ->values(array(
103 104 105
    'name' => 'taxonomy_terms_per_page_admin',
    'value' => 'i:32;',
  ))
106
  ->values(array(
107 108
    'name' => 'taxonomy_maintain_index_table',
    'value' => 'i:0;',
109
  ))
110 111 112 113 114
  ->values(array(
    'name' => 'filter_allowed_protocols',
    'value' => 'a:4:{i:0;s:4:"http";i:1;s:5:"https";i:2;s:3:"ftp";i:3;s:6:"mailto";}',
  ))
  ->values(array(
115 116
    'name' => 'password_count_log2',
    'value' => 'i:42;',
117 118
  ))
  ->values(array(
119 120 121
    'name' => 'actions_max_stack',
    'value' => 'i:42;',
  ))
122 123 124 125
  ->values(array(
    'name' => 'mail_system',
    'value' => 'a:2:{s:14:"default-system";s:17:"DefaultMailSystem";s:7:"maillog";s:17:"MaillogMailSystem";}',
  ))
126 127 128 129 130 131 132 133 134 135 136 137
  ->values(array(
    'name' => 'fast_404_paths',
    'value' => 's:74:"/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|aspi|pdf)$/i";',
  ))
  ->values(array(
    'name' => 'fast_404_excluded_paths',
    'value' => 's:27:"/\/(?:styles|imagecache)\//";',
  ))
  ->values(array(
    'name' => 'fast_404_html',
    'value' => 's:168:"<!DOCTYPE html><html><head><title>Page Not Found</title></head><body><h1>Page Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>";',
  ))
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
  ->values(array(
    'name' => 'aggregator_fetcher',
    'value' => 's:12:"test_fetcher";',
  ))
  ->values(array(
    'name' => 'aggregator_parser',
    'value' => 's:11:"test_parser";',
  ))
  ->values(array(
    'name' => 'aggregator_processors',
    'value' => 'a:1:{i:0;s:14:"test_processor";}',
  ))
  ->values(array(
    'name' => 'aggregator_allowed_html_tags',
    'value' => 's:3:"<a>";',
  ))
  ->values(array(
    'name' => 'aggregator_teaser_length',
    'value' => 'i:6000;',
  ))
  ->values(array(
    'name' => 'aggregator_clear',
    'value' => 'i:10;',
  ))
  ->values(array(
    'name' => 'aggregator_summary_items',
    'value' => 'i:5;',
  ))
166
  ->execute();
167 168 169 170 171 172

db_update('variable')
  ->fields(array('value' => 's:18:"config@example.com";'))
  ->condition('name', 'site_mail')
  ->execute();
db_update('variable')
173 174 175
  ->fields(array('value' => 's:22:"Testing config upgrade";'))
  ->condition('name', 'site_name')
  ->execute();
176 177 178 179
db_update('variable')
  ->fields(array('value' => 's:10:"plain_text";'))
  ->condition('name', 'filter_fallback_format')
  ->execute();
180
db_update('variable')
181
  ->fields(array('value' => 'a:2:{i:0;s:4:"test";i:1;s:4:"book";}'))
182 183
  ->condition('name', 'book_allowed_types')
  ->execute();
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198

// color module in bartik
$palette = array(
  'top' => '#8eccf2',
  'bottom' => '#48a9e4',
  'bg' => '#ffffff',
  'sidebar' => '#f6f6f2',
  'sidebarborders' => '#f9f9f9',
  'footer' => '#db2a2a',
  'titleslogan' => '#fffeff',
  'text' => '#fb8484',
  'link' => '#3587b7',
);

db_insert('variable')->fields(array(
199 200 201
    'name',
    'value',
  ))
202
  ->values(array(
203
    'name' => 'color_bartik_files',
204
    'value' => serialize(array('public://color/bartik-09696463/logo.svg', 'public://color/bartik-09696463/colors.css')),
205
  ))
206
  ->values(array(
207
    'name' => 'color_bartik_logo',
208
    'value' => serialize('public://color/bartik-09696463/logo.svg'),
209
  ))
210
  ->values(array(
211 212 213
    'name' => 'color_bartik_palette',
    'value' => serialize($palette),
  ))
214
  ->values(array(
215 216 217
    'name' => 'color_bartik_stylesheets',
    'value' => serialize('public://color/bartik-09696463/colors.css'),
  ))
218 219 220 221
  ->execute();

// color module with faked seven upgrade path to test screenshot option
db_insert('variable')->fields(array(
222 223 224
    'name',
    'value',
  ))
225
  ->values(array(
226
    'name' => 'color_seven_files',
227
    'value' => serialize(array('public://color/seven-09696463/logo.svg', 'public://color/seven-09696463/colors.css')),
228
  ))
229
  ->values(array(
230
    'name' => 'color_seven_logo',
231
    'value' => serialize('public://color/seven-09696463/logo.svg'),
232
  ))
233
  ->values(array(
234 235 236
    'name' => 'color_seven_palette',
    'value' => serialize($palette),
  ))
237
  ->values(array(
238 239 240
    'name' => 'color_seven_stylesheets',
    'value' => serialize('public://color/seven-09696463/colors.css'),
  ))
241
  ->values(array(
242 243 244
    'name' => 'color_seven_screenshot',
    'value' => serialize('public://color/seven-09696463/dummy-screenshot.png'),
  ))
245
  ->execute();
246 247 248 249 250

db_update('variable')
  ->fields(array('value' => 's:7:"minimal";'))
  ->condition('name', 'install_profile')
  ->execute();