drupal-7.language.database.php 18.5 KB
Newer Older
Dries's avatar
Dries committed
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

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

// Add blocks respective for language functionality.
14
15
16
17
db_delete('block')
  ->condition('module', 'locale')
  ->execute();

Dries's avatar
Dries committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
db_insert('block')->fields(array(
  'module',
  'delta',
  'theme',
  'status',
  'weight',
  'region',
  'custom',
  'visibility',
  'pages',
  'title',
  'cache',
))
->values(array(
  'module' => 'locale',
  'delta' => 'language',
  'theme' => 'bartik',
35
  'status' => '1',
Dries's avatar
Dries committed
36
  'weight' => '0',
37
  'region' => 'sidebar_first',
Dries's avatar
Dries committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  'custom' => '0',
  'visibility' => '0',
  'pages' => '',
  'title' => '',
  'cache' => '-1',
))
->values(array(
  'module' => 'locale',
  'delta' => 'language',
  'theme' => 'seven',
  'status' => '0',
  'weight' => '0',
  'region' => '-1',
  'custom' => '0',
  'visibility' => '0',
  'pages' => '',
  'title' => '',
  'cache' => '-1',
))
->execute();

59
60
// Prefill languages table from locale.install with some default languages
// for testing.
Dries's avatar
Dries committed
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
db_insert('languages')->fields(array(
  'language',
  'name',
  'native',
  'direction',
  'enabled',
  'plurals',
  'formula',
  'domain',
  'prefix',
  'weight',
  'javascript',
))
->values(array(
  'language' => 'ca',
  'name' => 'Catalan',
  'native' => 'Català',
  'direction' => '0',
  'enabled' => '1',
  'plurals' => '2',
  'formula' => '($n>1)',
  'domain' => '',
  'prefix' => 'ca',
  'weight' => '0',
  'javascript' => '',
))
->values(array(
  'language' => 'cv',
  'name' => 'Chuvash',
  'native' => 'Chuvash',
  'direction' => '0',
  'enabled' => '1',
  'plurals' => '0',
  'formula' => '',
  'domain' => '',
  'prefix' => 'cv',
  'weight' => '0',
  'javascript' => '',
))
100
101
102
103
104
105
106
107
108
109
110
111
112
->values(array(
  'language' => 'hr',
  'name' => 'Croatian',
  'native' => 'Hrvatski',
  'direction' => '0',
  'enabled' => '1',
  'plurals' => '3',
  'formula' => '((($n%10)==1)&&(($n%100)!=11))?(0):((((($n%10)>=2)&&(($n%10)<=4))&&((($n%100)<10)||(($n%100)>=20)))?(1):2));',
  'domain' => '',
  'prefix' => '',
  'weight' => '0',
  'javascript' => '',
))
Dries's avatar
Dries committed
113
114
->execute();

115
116
// Fill locales_source table from locale.install schema with some sample data
// for testing.
Dries's avatar
Dries committed
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
db_insert('locales_source')->fields(array(
  'lid',
  'location',
  'textgroup',
  'source',
  'context',
  'version',
))
->values(array(
  'lid' => '1',
  'location' => 'misc/drupal.js',
  'textgroup' => 'default',
  'source' => 'An AJAX HTTP error occurred.',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '2',
  'location' => 'misc/drupal.js',
  'textgroup' => 'default',
  'source' => 'HTTP Result Code: !status',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '3',
  'location' => 'misc/drupal.js',
  'textgroup' => 'default',
  'source' => 'An AJAX HTTP request terminated abnormally.',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '4',
  'location' => 'misc/drupal.js',
  'textgroup' => 'default',
  'source' => 'Debugging information follows.',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '5',
  'location' => 'misc/drupal.js',
  'textgroup' => 'default',
  'source' => 'Path: !uri',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '6',
  'location' => 'misc/drupal.js',
  'textgroup' => 'default',
  'source' => 'StatusText: !statusText',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '7',
  'location' => 'misc/drupal.js',
  'textgroup' => 'default',
  'source' => 'ResponseText: !responseText',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '8',
  'location' => 'misc/drupal.js',
  'textgroup' => 'default',
  'source' => 'ReadyState: !readyState',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '9',
  'location' => 'modules/overlay/overlay-parent.js',
  'textgroup' => 'default',
  'source' => '@title dialog',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '10',
  'location' => 'modules/contextual/contextual.js',
  'textgroup' => 'default',
  'source' => 'Configure',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '11',
  'location' => 'modules/toolbar/toolbar.js',
  'textgroup' => 'default',
  'source' => 'Show shortcuts',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '12',
  'location' => 'modules/toolbar/toolbar.js',
  'textgroup' => 'default',
  'source' => 'Hide shortcuts',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '13',
  'location' => 'modules/overlay/overlay-child.js',
  'textgroup' => 'default',
  'source' => 'Loading',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '14',
  'location' => 'modules/overlay/overlay-child.js',
  'textgroup' => 'default',
  'source' => '(active tab)',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '15',
  'location' => 'misc/tabledrag.js',
  'textgroup' => 'default',
  'source' => 'Re-order rows by numerical weight instead of dragging.',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '16',
  'location' => 'misc/tabledrag.js',
  'textgroup' => 'default',
  'source' => 'Show row weights',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '17',
  'location' => 'misc/tabledrag.js',
  'textgroup' => 'default',
  'source' => 'Hide row weights',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '18',
  'location' => 'misc/tabledrag.js',
  'textgroup' => 'default',
  'source' => 'Drag to re-order',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '19',
  'location' => 'misc/tabledrag.js',
  'textgroup' => 'default',
  'source' => 'Changes made in this table will not be saved until the form is submitted.',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '20',
  'location' => 'misc/collapse.js',
  'textgroup' => 'default',
  'source' => 'Hide',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '21',
  'location' => 'misc/collapse.js',
  'textgroup' => 'default',
  'source' => 'Show',
  'context' => '',
  'version' => 'none',
))
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
->values(array(
  'lid' => '22',
  'location' => '',
  'textgroup' => 'default',
  'source' => '1 byte',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '23',
  'location' => '',
  'textgroup' => 'default',
  'source' => '@count bytes',
  'context' => '',
  'version' => 'none',
))
->values(array(
  'lid' => '24',
  'location' => '',
  'textgroup' => 'default',
  'source' => '@count[2] bytes',
  'context' => '',
  'version' => 'none',
))
Dries's avatar
Dries committed
317
318
->execute();

319
320
// Fill locales_target table from locale.install schema with some sample data
// for testing.
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
db_insert('locales_target')->fields(array(
  'lid',
  'translation',
  'language',
  'plid',
  'plural',
))
->values(array(
  'lid' => 22,
  'translation' => '1 byte',
  'language' => 'ca',
  'plid' => 0,
  'plural' => 0,
))
->values(array(
  'lid' => 23,
  'translation' => '@count bytes',
  'language' => 'ca',
  'plid' => 22,
  'plural' => 1,
))
->values(array(
  'lid' => 22,
  'translation' => '@count bajt',
  'language' => 'hr',
  'plid' => 0,
  'plural' => 0,
))
->values(array(
  'lid' => 23,
  'translation' => '@count bajta',
  'language' => 'hr',
  'plid' => 22,
  'plural' => 1,
))
->values(array(
  'lid' => 24,
  'translation' => '@count[2] bajtova',
  'language' => 'hr',
  'plid' => 23,
  'plural' => 2,
))
->execute();
Dries's avatar
Dries committed
364
365

// Set up variables needed for language support.
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
$deleted_variables = array(
  'javascript_parsed',
  'language_count',
  'language_default',
  'language_negotiation_language',
  'language_negotiation_language_content',
  'language_negotiation_language_url',
  'language_types',
  'locale_language_providers_weight_language',
  'language_content_type_article',
);
db_delete('variable')
  ->condition('name', $deleted_variables, 'IN')
  ->execute();

Dries's avatar
Dries committed
381
382
383
384
385
386
387
388
389
390
391
392
393
394
db_insert('variable')->fields(array(
  'name',
  'value',
))
->values(array(
  'name' => 'javascript_parsed',
  'value' => 'a:16:{i:0;s:14:"misc/drupal.js";i:1;s:14:"misc/jquery.js";i:2;s:19:"misc/jquery.once.js";s:10:"refresh:ca";s:7:"waiting";i:3;s:29:"misc/ui/jquery.ui.core.min.js";i:4;s:21:"misc/jquery.ba-bbq.js";i:5;s:33:"modules/overlay/overlay-parent.js";i:6;s:32:"modules/contextual/contextual.js";i:7;s:21:"misc/jquery.cookie.js";i:8;s:26:"modules/toolbar/toolbar.js";i:9;s:32:"modules/overlay/overlay-child.js";i:10;s:19:"misc/tableheader.js";i:11;s:17:"misc/tabledrag.js";i:12;s:12:"misc/form.js";i:13;s:16:"misc/collapse.js";s:10:"refresh:cv";s:7:"waiting";}',
))
->values(array(
  'name' => 'language_count',
  'value' => 'i:3;',
))
->values(array(
  'name' => 'language_default',
395
  'value' => 'O:8:"stdClass":7:{s:8:"language";s:2:"ca";s:4:"name";s:7:"Catalan";s:9:"direction";i:0;s:7:"enabled";b:1;s:6:"weight";i:0;s:7:"default";b:1;s:6:"is_new";b:1;}',
Dries's avatar
Dries committed
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
))
->values(array(
  'name' => 'language_negotiation_language',
  'value' => 'a:5:{s:10:"locale-url";a:2:{s:9:"callbacks";a:3:{s:8:"language";s:24:"locale_language_from_url";s:8:"switcher";s:28:"locale_language_switcher_url";s:11:"url_rewrite";s:31:"locale_language_url_rewrite_url";}s:4:"file";s:19:"includes/locale.inc";}s:14:"locale-session";a:2:{s:9:"callbacks";a:3:{s:8:"language";s:28:"locale_language_from_session";s:8:"switcher";s:32:"locale_language_switcher_session";s:11:"url_rewrite";s:35:"locale_language_url_rewrite_session";}s:4:"file";s:19:"includes/locale.inc";}s:11:"locale-user";a:2:{s:9:"callbacks";a:1:{s:8:"language";s:25:"locale_language_from_user";}s:4:"file";s:19:"includes/locale.inc";}s:14:"locale-browser";a:3:{s:9:"callbacks";a:1:{s:8:"language";s:28:"locale_language_from_browser";}s:4:"file";s:19:"includes/locale.inc";s:5:"cache";i:0;}s:16:"language-default";a:1:{s:9:"callbacks";a:1:{s:8:"language";s:21:"language_from_default";}}}',
))
->values(array(
  'name' => 'language_negotiation_language_content',
  'value' => 'a:1:{s:16:"locale-interface";a:2:{s:9:"callbacks";a:1:{s:8:"language";s:30:"locale_language_from_interface";}s:4:"file";s:19:"includes/locale.inc";}}',
))
->values(array(
  'name' => 'language_negotiation_language_url',
  'value' => 'a:2:{s:10:"locale-url";a:2:{s:9:"callbacks";a:3:{s:8:"language";s:24:"locale_language_from_url";s:8:"switcher";s:28:"locale_language_switcher_url";s:11:"url_rewrite";s:31:"locale_language_url_rewrite_url";}s:4:"file";s:19:"includes/locale.inc";}s:19:"locale-url-fallback";a:2:{s:9:"callbacks";a:1:{s:8:"language";s:28:"locale_language_url_fallback";}s:4:"file";s:19:"includes/locale.inc";}}',
))
->values(array(
  'name' => 'language_types',
  'value' => 'a:3:{s:8:"language";b:1;s:16:"language_content";b:0;s:12:"language_url";b:0;}',
))
->values(array(
  'name' => 'locale_language_providers_weight_language',
  'value' => 'a:5:{s:10:"locale-url";s:2:"-8";s:14:"locale-session";s:2:"-6";s:11:"locale-user";s:2:"-4";s:14:"locale-browser";s:2:"-2";s:16:"language-default";s:2:"10";}',
))
417
418
->values(array(
  'name' => 'language_content_type_article',
419
  'value' => 's:1:"2";',
420
))
Dries's avatar
Dries committed
421
422
->execute();

423
424
// Add sample nodes to test language assignment and translation functionality.
// The first node is also used for testing comment language functionality. This
425
// is a simple node with Language::LANGCODE_NOT_SPECIFIED as language code. The second
426
427
428
// node is a Catalan node (language code 'ca'). The third and fourth node are a
// translation set with an English source translation (language code 'en') and
// a Chuvash translation (language code 'cv').
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
db_insert('node')->fields(array(
  'nid',
  'vid',
  'type',
  'language',
  'title',
  'uid',
  'status',
  'created',
  'changed',
  'comment',
  'promote',
  'sticky',
  'tnid',
  'translate',
))
->values(array(
446
447
  'nid' => '50',
  'vid' => '70',
448
449
  'type' => 'article',
  'language' => 'und',
450
  'title' => 'Node title 50',
451
452
453
454
455
456
457
458
459
460
  'uid' => '6',
  'status' => '1',
  'created' => '1263769200',
  'changed' => '1314997642',
  'comment' => '2',
  'promote' => '0',
  'sticky' => '0',
  'tnid' => '0',
  'translate' => '0',
))
461
->values(array(
462
463
  'nid' => '51',
  'vid' => '75',
464
465
  'type' => 'article',
  'language' => 'ca',
466
  'title' => 'Node title 51',
467
468
469
470
471
472
473
474
475
476
477
  'uid' => '6',
  'status' => '1',
  'created' => '1263769300',
  'changed' => '1263769300',
  'comment' => '0',
  'promote' => '0',
  'sticky' => '0',
  'tnid' => '0',
  'translate' => '0',
))
->values(array(
478
479
  'nid' => '52',
  'vid' => '80',
480
481
  'type' => 'article',
  'language' => 'en',
482
  'title' => 'Node title 52',
483
484
485
486
487
488
489
  'uid' => '6',
  'status' => '1',
  'created' => '1263769534',
  'changed' => '1263769534',
  'comment' => '0',
  'promote' => '0',
  'sticky' => '0',
490
  'tnid' => '52',
491
492
493
  'translate' => '0',
))
->values(array(
494
495
  'nid' => '53',
  'vid' => '85',
496
497
  'type' => 'article',
  'language' => 'cv',
498
  'title' => 'Node title 53',
499
500
501
502
503
504
505
  'uid' => '6',
  'status' => '1',
  'created' => '1263770064',
  'changed' => '1263770064',
  'comment' => '0',
  'promote' => '0',
  'sticky' => '0',
506
  'tnid' => '52',
507
508
  'translate' => '0',
))
509
510
->execute();

511
// Add node comment statistics for the first node.
512
513
514
515
516
517
518
519
520
db_insert('node_comment_statistics')->fields(array(
  'nid',
  'cid',
  'last_comment_timestamp',
  'last_comment_name',
  'last_comment_uid',
  'comment_count',
))
->values(array(
521
  'nid' => '50',
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
  'cid' => '0',
  'last_comment_timestamp' => '1314997642',
  'last_comment_name' => NULL,
  'last_comment_uid' => '6',
  'comment_count' => '1',
))
->execute();

// Add node revision information.
db_insert('node_revision')->fields(array(
  'nid',
  'vid',
  'uid',
  'title',
  'log',
  'timestamp',
  'status',
  'comment',
  'promote',
  'sticky',
))
->values(array(
544
545
  'nid' => '50',
  'vid' => '70',
546
  'uid' => '6',
547
  'title' => 'Node title 50',
548
  'log' => 'Added a Language::LANGCODE_NOT_SPECIFIED node to comment on.',
549
550
551
552
553
554
  'timestamp' => '1314997642',
  'status' => '1',
  'comment' => '2',
  'promote' => '0',
  'sticky' => '0',
))
555
->values(array(
556
557
  'nid' => '51',
  'vid' => '75',
558
  'uid' => '6',
559
  'title' => 'Node title 51',
560
561
562
563
564
565
566
567
  'log' => 'Created a Catalan node.',
  'timestamp' => '1263769300',
  'status' => '1',
  'comment' => '0',
  'promote' => '0',
  'sticky' => '0',
))
->values(array(
568
569
  'nid' => '52',
  'vid' => '80',
570
  'uid' => '6',
571
  'title' => 'Node title 52',
572
573
574
575
576
577
578
579
  'log' => 'Created source translation in English.',
  'timestamp' => '1263769534',
  'status' => '1',
  'comment' => '0',
  'promote' => '0',
  'sticky' => '0',
))
->values(array(
580
581
  'nid' => '53',
  'vid' => '85',
582
  'uid' => '6',
583
  'title' => 'Node title 53',
584
585
586
587
588
589
590
  'log' => 'Created Chuvash translation.',
  'timestamp' => '1263770064',
  'status' => '1',
  'comment' => '0',
  'promote' => '0',
  'sticky' => '0',
))
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
->execute();

// Add the body field value.
db_insert('field_data_body')->fields(array(
  'entity_type',
  'bundle',
  'deleted',
  'entity_id',
  'revision_id',
  'language',
  'delta',
  'body_value',
  'body_summary',
  'body_format',
))
->values(array(
  'entity_type' => 'node',
  'bundle' => 'article',
  'deleted' => '0',
610
611
  'entity_id' => '50',
  'revision_id' => '70',
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
  'language' => 'und',
  'delta' => '0',
  'body_value' => 'Node body',
  'body_summary' => 'Node body',
  'body_format' => 'filtered_html',
))
->execute();

// Add revision information for the body field value.
db_insert('field_revision_body')->fields(array(
  'entity_type',
  'bundle',
  'deleted',
  'entity_id',
  'revision_id',
  'language',
  'delta',
  'body_value',
  'body_summary',
  'body_format',
))
->values(array(
  'entity_type' => 'node',
  'bundle' => 'article',
  'deleted' => '0',
637
638
  'entity_id' => '50',
  'revision_id' => '70',
639
640
641
642
643
644
645
646
  'language' => 'und',
  'delta' => '0',
  'body_value' => 'Node body',
  'body_summary' => 'Node body',
  'body_format' => 'filtered_html',
))
->execute();

647
// Add two comments to the first node in a thread.
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
db_insert('comment')->fields(array(
  'cid',
  'pid',
  'nid',
  'uid',
  'subject',
  'hostname',
  'created',
  'changed',
  'status',
  'thread',
  'name',
  'mail',
  'homepage',
  'language',
))
->values(array(
  'cid' => '1',
  'pid' => '0',
667
  'nid' => '50',
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
  'uid' => '6',
  'subject' => 'First test comment',
  'hostname' => '127.0.0.1',
  'created' => '1314997642',
  'changed' => '1314997642',
  'status' => '1',
  'thread' => '01/',
  'name' => 'test user 4',
  'mail' => '',
  'homepage' => '',
  'language' => 'und',
))
->values(array(
  'cid' => '2',
  'pid' => '0',
683
  'nid' => '50',
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
  'uid' => '6',
  'subject' => 'Reply to first test comment',
  'hostname' => '127.0.0.1',
  'created' => '1314997642',
  'changed' => '1314997642',
  'status' => '1',
  'thread' => '01.00/',
  'name' => 'test user 4',
  'mail' => '',
  'homepage' => '',
  'language' => 'und',
))
->execute();

// Add both comment bodies.
db_insert('field_data_comment_body')->fields(array(
  'entity_type',
  'bundle',
  'deleted',
  'entity_id',
  'revision_id',
  'language',
  'delta',
  'comment_body_value',
  'comment_body_format',
))
->values(array(
  'entity_type' => 'comment',
  'bundle' => 'comment_node_article',
  'deleted' => '0',
  'entity_id' => '1',
  'revision_id' => '1',
  'language' => 'und',
  'delta' => '0',
  'comment_body_value' => 'Comment body',
  'comment_body_format' => 'filtered_html',
))
->values(array(
  'entity_type' => 'comment',
  'bundle' => 'comment_node_article',
  'deleted' => '0',
  'entity_id' => '2',
  'revision_id' => '2',
  'language' => 'und',
  'delta' => '0',
  'comment_body_value' => 'Second comment body',
  'comment_body_format' => 'filtered_html',
))
->execute();

// Add revisions for comment bodies.
db_insert('field_revision_comment_body')->fields(array(
  'entity_type',
  'bundle',
  'deleted',
  'entity_id',
  'revision_id',
  'language',
  'delta',
  'comment_body_value',
  'comment_body_format',
))
->values(array(
  'entity_type' => 'comment',
  'bundle' => 'comment_node_article',
  'deleted' => '0',
  'entity_id' => '1',
  'revision_id' => '1',
  'language' => 'und',
  'delta' => '0',
  'comment_body_value' => 'Comment body',
  'comment_body_format' => 'filtered_html',
))
->values(array(
  'entity_type' => 'comment',
  'bundle' => 'comment_node_article',
  'deleted' => '0',
  'entity_id' => '2',
  'revision_id' => '2',
  'language' => 'und',
  'delta' => '0',
  'comment_body_value' => 'Second comment body',
  'comment_body_format' => 'filtered_html',
))
->execute();
769
770
771
772
773
774
775
776
777
778

// Add a managed file.
db_insert('file_managed')->fields(array(
  'fid',
  'uid',
  'filename',
  'uri',
  'filemime',
  'filesize',
  'status',
779
780
  'created',
  'changed',
781
782
783
784
785
786
787
788
789
))
->values(array(
  'fid' => '1',
  'uid' => '1',
  'filename' => 'foo.txt',
  'uri' => 'public://foo.txt',
  'filemime' => 'text/plain',
  'filesize' => 0,
  'status' => 1,
790
791
  'created' => '1314997642',
  'changed' => '1314997642',
792
793
))
->execute();