File: ExportTest.php

package info (click to toggle)
phpmyadmin 4%3A5.2.2-really%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 140,312 kB
  • sloc: javascript: 228,447; php: 166,904; xml: 17,847; sql: 504; sh: 275; makefile: 209; python: 205
file content (665 lines) | stat: -rw-r--r-- 32,919 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
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
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
<?php

declare(strict_types=1);

namespace PhpMyAdmin\Tests\Config\Settings;

use PhpMyAdmin\Config\Settings\Export;
use PHPUnit\Framework\TestCase;

use function array_keys;
use function array_merge;

/**
 * @covers \PhpMyAdmin\Config\Settings\Export
 */
#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Export::class)]
class ExportTest extends TestCase
{
    /** @var array<string, bool|int|string> */
    private $defaultValues = [
        'format' => 'sql',
        'method' => 'quick',
        'compression' => 'none',
        'lock_tables' => false,
        'as_separate_files' => false,
        'asfile' => true,
        'charset' => '',
        'onserver' => false,
        'onserver_overwrite' => false,
        'quick_export_onserver' => false,
        'quick_export_onserver_overwrite' => false,
        'remember_file_template' => true,
        'file_template_table' => '@TABLE@',
        'file_template_database' => '@DATABASE@',
        'file_template_server' => '@SERVER@',
        'codegen_structure_or_data' => 'data',
        'codegen_format' => 0,
        'ods_columns' => false,
        'ods_null' => 'NULL',
        'odt_structure_or_data' => 'structure_and_data',
        'odt_columns' => true,
        'odt_relation' => true,
        'odt_comments' => true,
        'odt_mime' => true,
        'odt_null' => 'NULL',
        'htmlword_structure_or_data' => 'structure_and_data',
        'htmlword_columns' => false,
        'htmlword_null' => 'NULL',
        'texytext_structure_or_data' => 'structure_and_data',
        'texytext_columns' => false,
        'texytext_null' => 'NULL',
        'csv_columns' => true,
        'csv_structure_or_data' => 'data',
        'csv_null' => 'NULL',
        'csv_separator' => ',',
        'csv_enclosed' => '"',
        'csv_escaped' => '"',
        'csv_terminated' => 'AUTO',
        'csv_removeCRLF' => false,
        'excel_columns' => true,
        'excel_null' => 'NULL',
        'excel_edition' => 'win',
        'excel_removeCRLF' => false,
        'excel_structure_or_data' => 'data',
        'latex_structure_or_data' => 'structure_and_data',
        'latex_columns' => true,
        'latex_relation' => true,
        'latex_comments' => true,
        'latex_mime' => true,
        'latex_null' => '\\textit{NULL}',
        'latex_caption' => true,
        'latex_structure_caption' => 'strLatexStructure',
        'latex_structure_continued_caption' => 'strLatexStructure strLatexContinued',
        'latex_data_caption' => 'strLatexContent',
        'latex_data_continued_caption' => 'strLatexContent strLatexContinued',
        'latex_data_label' => 'tab:@TABLE@-data',
        'latex_structure_label' => 'tab:@TABLE@-structure',
        'mediawiki_structure_or_data' => 'data',
        'mediawiki_caption' => true,
        'mediawiki_headers' => true,
        'ods_structure_or_data' => 'data',
        'pdf_structure_or_data' => 'data',
        'phparray_structure_or_data' => 'data',
        'json_structure_or_data' => 'data',
        'json_pretty_print' => false,
        'json_unicode' => true,
        'sql_structure_or_data' => 'structure_and_data',
        'sql_compatibility' => 'NONE',
        'sql_include_comments' => true,
        'sql_disable_fk' => false,
        'sql_views_as_tables' => false,
        'sql_metadata' => false,
        'sql_use_transaction' => true,
        'sql_create_database' => false,
        'sql_drop_database' => false,
        'sql_drop_table' => false,
        'sql_if_not_exists' => false,
        'sql_view_current_user' => false,
        'sql_or_replace_view' => false,
        'sql_procedure_function' => true,
        'sql_create_table' => true,
        'sql_create_view' => true,
        'sql_create_trigger' => true,
        'sql_auto_increment' => true,
        'sql_backquotes' => true,
        'sql_dates' => false,
        'sql_relation' => false,
        'sql_truncate' => false,
        'sql_delayed' => false,
        'sql_ignore' => false,
        'sql_utc_time' => true,
        'sql_hex_for_binary' => true,
        'sql_type' => 'INSERT',
        'sql_max_query_size' => 50000,
        'sql_mime' => false,
        'sql_header_comment' => '',
        'sql_insert_syntax' => 'both',
        'pdf_report_title' => '',
        'xml_structure_or_data' => 'data',
        'xml_export_struc' => true,
        'xml_export_events' => true,
        'xml_export_functions' => true,
        'xml_export_procedures' => true,
        'xml_export_tables' => true,
        'xml_export_triggers' => true,
        'xml_export_views' => true,
        'xml_export_contents' => true,
        'yaml_structure_or_data' => 'data',
    ];

    /**
     * @param mixed[][] $values
     * @psalm-param (array{0: string, 1: mixed, 2: mixed})[] $values
     *
     * @dataProvider providerForTestConstructor
     */
    #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')]
    public function testConstructor(array $values): void
    {
        $actualValues = [];
        $expectedValues = [];
        /** @psalm-suppress MixedAssignment */
        foreach ($values as $value) {
            $actualValues[$value[0]] = $value[1];
            $expectedValues[$value[0]] = $value[2];
        }

        $expected = array_merge($this->defaultValues, $expectedValues);
        $settings = new Export($actualValues);

        foreach (array_keys($expectedValues) as $key) {
            self::assertSame($expected[$key], $settings->$key);
        }
    }

    /**
     * [setting key, actual value, expected value]
     *
     * @return mixed[][][][]
     * @psalm-return (array{0: string, 1: mixed, 2: mixed})[][][]
     */
    public static function providerForTestConstructor(): array
    {
        return [
            'null values' => [
                [
                    ['format', null, 'sql'],
                    ['method', null, 'quick'],
                    ['compression', null, 'none'],
                    ['lock_tables', null, false],
                    ['as_separate_files', null, false],
                    ['asfile', null, true],
                    ['charset', null, ''],
                    ['onserver', null, false],
                    ['onserver_overwrite', null, false],
                    ['quick_export_onserver', null, false],
                    ['quick_export_onserver_overwrite', null, false],
                    ['remember_file_template', null, true],
                    ['file_template_table', null, '@TABLE@'],
                    ['file_template_database', null, '@DATABASE@'],
                    ['file_template_server', null, '@SERVER@'],
                    ['codegen_structure_or_data', null, 'data'],
                    ['codegen_format', null, 0],
                    ['ods_columns', null, false],
                    ['ods_null', null, 'NULL'],
                    ['odt_structure_or_data', null, 'structure_and_data'],
                    ['odt_columns', null, true],
                    ['odt_relation', null, true],
                    ['odt_comments', null, true],
                    ['odt_mime', null, true],
                    ['odt_null', null, 'NULL'],
                    ['htmlword_structure_or_data', null, 'structure_and_data'],
                    ['htmlword_columns', null, false],
                    ['htmlword_null', null, 'NULL'],
                    ['texytext_structure_or_data', null, 'structure_and_data'],
                    ['texytext_columns', null, false],
                    ['texytext_null', null, 'NULL'],
                    ['csv_columns', null, true],
                    ['csv_structure_or_data', null, 'data'],
                    ['csv_null', null, 'NULL'],
                    ['csv_separator', null, ','],
                    ['csv_enclosed', null, '"'],
                    ['csv_escaped', null, '"'],
                    ['csv_terminated', null, 'AUTO'],
                    ['csv_removeCRLF', null, false],
                    ['excel_columns', null, true],
                    ['excel_null', null, 'NULL'],
                    ['excel_edition', null, 'win'],
                    ['excel_removeCRLF', null, false],
                    ['excel_structure_or_data', null, 'data'],
                    ['latex_structure_or_data', null, 'structure_and_data'],
                    ['latex_columns', null, true],
                    ['latex_relation', null, true],
                    ['latex_comments', null, true],
                    ['latex_mime', null, true],
                    ['latex_null', null, '\textit{NULL}'],
                    ['latex_caption', null, true],
                    ['latex_structure_caption', null, 'strLatexStructure'],
                    ['latex_structure_continued_caption', null, 'strLatexStructure strLatexContinued'],
                    ['latex_data_caption', null, 'strLatexContent'],
                    ['latex_data_continued_caption', null, 'strLatexContent strLatexContinued'],
                    ['latex_data_label', null, 'tab:@TABLE@-data'],
                    ['latex_structure_label', null, 'tab:@TABLE@-structure'],
                    ['mediawiki_structure_or_data', null, 'data'],
                    ['mediawiki_caption', null, true],
                    ['mediawiki_headers', null, true],
                    ['ods_structure_or_data', null, 'data'],
                    ['pdf_structure_or_data', null, 'data'],
                    ['phparray_structure_or_data', null, 'data'],
                    ['json_structure_or_data', null, 'data'],
                    ['json_pretty_print', null, false],
                    ['json_unicode', null, true],
                    ['sql_structure_or_data', null, 'structure_and_data'],
                    ['sql_compatibility', null, 'NONE'],
                    ['sql_include_comments', null, true],
                    ['sql_disable_fk', null, false],
                    ['sql_views_as_tables', null, false],
                    ['sql_metadata', null, false],
                    ['sql_use_transaction', null, true],
                    ['sql_create_database', null, false],
                    ['sql_drop_database', null, false],
                    ['sql_drop_table', null, false],
                    ['sql_if_not_exists', null, false],
                    ['sql_view_current_user', null, false],
                    ['sql_or_replace_view', null, false],
                    ['sql_procedure_function', null, true],
                    ['sql_create_table', null, true],
                    ['sql_create_view', null, true],
                    ['sql_create_trigger', null, true],
                    ['sql_auto_increment', null, true],
                    ['sql_backquotes', null, true],
                    ['sql_dates', null, false],
                    ['sql_relation', null, false],
                    ['sql_truncate', null, false],
                    ['sql_delayed', null, false],
                    ['sql_ignore', null, false],
                    ['sql_utc_time', null, true],
                    ['sql_hex_for_binary', null, true],
                    ['sql_type', null, 'INSERT'],
                    ['sql_max_query_size', null, 50000],
                    ['sql_mime', null, false],
                    ['sql_header_comment', null, ''],
                    ['sql_insert_syntax', null, 'both'],
                    ['pdf_report_title', null, ''],
                    ['xml_structure_or_data', null, 'data'],
                    ['xml_export_struc', null, true],
                    ['xml_export_events', null, true],
                    ['xml_export_functions', null, true],
                    ['xml_export_procedures', null, true],
                    ['xml_export_tables', null, true],
                    ['xml_export_triggers', null, true],
                    ['xml_export_views', null, true],
                    ['xml_export_contents', null, true],
                    ['yaml_structure_or_data', null, 'data'],
                ],
            ],
            'valid values' => [
                [
                    ['format', 'codegen', 'codegen'],
                    ['method', 'quick', 'quick'],
                    ['compression', 'none', 'none'],
                    ['lock_tables', false, false],
                    ['as_separate_files', false, false],
                    ['asfile', true, true],
                    ['charset', 'test', 'test'],
                    ['onserver', false, false],
                    ['onserver_overwrite', false, false],
                    ['quick_export_onserver', false, false],
                    ['quick_export_onserver_overwrite', false, false],
                    ['remember_file_template', true, true],
                    ['file_template_table', 'test', 'test'],
                    ['file_template_database', 'test', 'test'],
                    ['file_template_server', 'test', 'test'],
                    ['codegen_structure_or_data', 'structure', 'structure'],
                    ['codegen_format', 0, 0],
                    ['ods_columns', false, false],
                    ['ods_null', 'test', 'test'],
                    ['odt_structure_or_data', 'structure', 'structure'],
                    ['odt_columns', true, true],
                    ['odt_relation', true, true],
                    ['odt_comments', true, true],
                    ['odt_mime', true, true],
                    ['odt_null', 'test', 'test'],
                    ['htmlword_structure_or_data', 'structure', 'structure'],
                    ['htmlword_columns', false, false],
                    ['htmlword_null', 'test', 'test'],
                    ['texytext_structure_or_data', 'structure', 'structure'],
                    ['texytext_columns', false, false],
                    ['texytext_null', 'test', 'test'],
                    ['csv_columns', true, true],
                    ['csv_structure_or_data', 'structure', 'structure'],
                    ['csv_null', 'test', 'test'],
                    ['csv_separator', 'test', 'test'],
                    ['csv_enclosed', 'test', 'test'],
                    ['csv_escaped', 'test', 'test'],
                    ['csv_terminated', 'test', 'test'],
                    ['csv_removeCRLF', false, false],
                    ['excel_columns', true, true],
                    ['excel_null', 'test', 'test'],
                    ['excel_edition', 'win', 'win'],
                    ['excel_removeCRLF', false, false],
                    ['excel_structure_or_data', 'structure', 'structure'],
                    ['latex_structure_or_data', 'structure', 'structure'],
                    ['latex_columns', true, true],
                    ['latex_relation', true, true],
                    ['latex_comments', true, true],
                    ['latex_mime', true, true],
                    ['latex_null', 'test', 'test'],
                    ['latex_caption', true, true],
                    ['latex_structure_caption', 'test', 'test'],
                    ['latex_structure_continued_caption', 'test', 'test'],
                    ['latex_data_caption', 'test', 'test'],
                    ['latex_data_continued_caption', 'test', 'test'],
                    ['latex_data_label', 'test', 'test'],
                    ['latex_structure_label', 'test', 'test'],
                    ['mediawiki_structure_or_data', 'structure', 'structure'],
                    ['mediawiki_caption', true, true],
                    ['mediawiki_headers', true, true],
                    ['ods_structure_or_data', 'structure', 'structure'],
                    ['pdf_structure_or_data', 'structure', 'structure'],
                    ['phparray_structure_or_data', 'structure', 'structure'],
                    ['json_structure_or_data', 'structure', 'structure'],
                    ['json_pretty_print', false, false],
                    ['json_unicode', true, true],
                    ['sql_structure_or_data', 'structure', 'structure'],
                    ['sql_compatibility', 'NONE', 'NONE'],
                    ['sql_include_comments', true, true],
                    ['sql_disable_fk', false, false],
                    ['sql_views_as_tables', false, false],
                    ['sql_metadata', false, false],
                    ['sql_use_transaction', true, true],
                    ['sql_create_database', false, false],
                    ['sql_drop_database', false, false],
                    ['sql_drop_table', false, false],
                    ['sql_if_not_exists', false, false],
                    ['sql_view_current_user', false, false],
                    ['sql_or_replace_view', false, false],
                    ['sql_procedure_function', true, true],
                    ['sql_create_table', true, true],
                    ['sql_create_view', true, true],
                    ['sql_create_trigger', true, true],
                    ['sql_auto_increment', true, true],
                    ['sql_backquotes', true, true],
                    ['sql_dates', false, false],
                    ['sql_relation', false, false],
                    ['sql_truncate', false, false],
                    ['sql_delayed', false, false],
                    ['sql_ignore', false, false],
                    ['sql_utc_time', true, true],
                    ['sql_hex_for_binary', true, true],
                    ['sql_type', 'INSERT', 'INSERT'],
                    ['sql_max_query_size', 0, 0],
                    ['sql_mime', false, false],
                    ['sql_header_comment', 'test', 'test'],
                    ['sql_insert_syntax', 'complete', 'complete'],
                    ['pdf_report_title', 'test', 'test'],
                    ['xml_structure_or_data', 'structure', 'structure'],
                    ['xml_export_struc', true, true],
                    ['xml_export_events', true, true],
                    ['xml_export_functions', true, true],
                    ['xml_export_procedures', true, true],
                    ['xml_export_tables', true, true],
                    ['xml_export_triggers', true, true],
                    ['xml_export_views', true, true],
                    ['xml_export_contents', true, true],
                    ['yaml_structure_or_data', 'structure', 'structure'],
                ],
            ],
            'valid values 2' => [
                [
                    ['format', 'csv', 'csv'],
                    ['method', 'custom', 'custom'],
                    ['compression', 'zip', 'zip'],
                    ['lock_tables', true, true],
                    ['as_separate_files', true, true],
                    ['asfile', false, false],
                    ['onserver', true, true],
                    ['onserver_overwrite', true, true],
                    ['quick_export_onserver', true, true],
                    ['quick_export_onserver_overwrite', true, true],
                    ['remember_file_template', false, false],
                    ['codegen_structure_or_data', 'data', 'data'],
                    ['codegen_format', 1, 1],
                    ['ods_columns', true, true],
                    ['odt_structure_or_data', 'data', 'data'],
                    ['odt_columns', false, false],
                    ['odt_relation', false, false],
                    ['odt_comments', false, false],
                    ['odt_mime', false, false],
                    ['htmlword_structure_or_data', 'data', 'data'],
                    ['htmlword_columns', true, true],
                    ['texytext_structure_or_data', 'data', 'data'],
                    ['texytext_columns', true, true],
                    ['csv_columns', false, false],
                    ['csv_structure_or_data', 'data', 'data'],
                    ['csv_removeCRLF', true, true],
                    ['excel_columns', false, false],
                    ['excel_edition', 'mac_excel2003', 'mac_excel2003'],
                    ['excel_removeCRLF', true, true],
                    ['excel_structure_or_data', 'data', 'data'],
                    ['latex_structure_or_data', 'data', 'data'],
                    ['latex_columns', false, false],
                    ['latex_relation', false, false],
                    ['latex_comments', false, false],
                    ['latex_mime', false, false],
                    ['latex_caption', false, false],
                    ['mediawiki_structure_or_data', 'data', 'data'],
                    ['mediawiki_caption', false, false],
                    ['mediawiki_headers', false, false],
                    ['ods_structure_or_data', 'data', 'data'],
                    ['pdf_structure_or_data', 'data', 'data'],
                    ['phparray_structure_or_data', 'data', 'data'],
                    ['json_structure_or_data', 'data', 'data'],
                    ['json_pretty_print', true, true],
                    ['json_unicode', false, false],
                    ['sql_structure_or_data', 'data', 'data'],
                    ['sql_compatibility', 'ANSI', 'ANSI'],
                    ['sql_include_comments', false, false],
                    ['sql_disable_fk', true, true],
                    ['sql_views_as_tables', true, true],
                    ['sql_metadata', true, true],
                    ['sql_use_transaction', false, false],
                    ['sql_create_database', true, true],
                    ['sql_drop_database', true, true],
                    ['sql_drop_table', true, true],
                    ['sql_if_not_exists', true, true],
                    ['sql_view_current_user', true, true],
                    ['sql_or_replace_view', true, true],
                    ['sql_procedure_function', false, false],
                    ['sql_create_table', false, false],
                    ['sql_create_view', false, false],
                    ['sql_create_trigger', false, false],
                    ['sql_auto_increment', false, false],
                    ['sql_backquotes', false, false],
                    ['sql_dates', true, true],
                    ['sql_relation', true, true],
                    ['sql_truncate', true, true],
                    ['sql_delayed', true, true],
                    ['sql_ignore', true, true],
                    ['sql_utc_time', false, false],
                    ['sql_hex_for_binary', false, false],
                    ['sql_type', 'UPDATE', 'UPDATE'],
                    ['sql_mime', true, true],
                    ['sql_insert_syntax', 'extended', 'extended'],
                    ['xml_structure_or_data', 'data', 'data'],
                    ['xml_export_struc', false, false],
                    ['xml_export_events', false, false],
                    ['xml_export_functions', false, false],
                    ['xml_export_procedures', false, false],
                    ['xml_export_tables', false, false],
                    ['xml_export_triggers', false, false],
                    ['xml_export_views', false, false],
                    ['xml_export_contents', false, false],
                    ['yaml_structure_or_data', 'data', 'data'],
                ],
            ],
            'valid values 3' => [
                [
                    ['format', 'excel', 'excel'],
                    ['method', 'custom-no-form', 'custom-no-form'],
                    ['compression', 'gzip', 'gzip'],
                    ['codegen_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['odt_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['htmlword_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['texytext_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['csv_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['excel_edition', 'mac_excel2008', 'mac_excel2008'],
                    ['excel_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['latex_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['mediawiki_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['ods_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['pdf_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['phparray_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['json_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['sql_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['sql_compatibility', 'DB2', 'DB2'],
                    ['sql_type', 'REPLACE', 'REPLACE'],
                    ['sql_insert_syntax', 'both', 'both'],
                    ['xml_structure_or_data', 'structure_and_data', 'structure_and_data'],
                    ['yaml_structure_or_data', 'structure_and_data', 'structure_and_data'],
                ],
            ],
            'valid values 4' => [
                [
                    ['format', 'htmlexcel', 'htmlexcel'],
                    ['sql_compatibility', 'MAXDB', 'MAXDB'],
                    ['sql_insert_syntax', 'none', 'none'],
                ],
            ],
            'valid values 5' => [
                [
                    ['format', 'htmlword', 'htmlword'],
                    ['sql_compatibility', 'MYSQL323', 'MYSQL323'],
                ],
            ],
            'valid values 6' => [
                [
                    ['format', 'latex', 'latex'],
                    ['sql_compatibility', 'MYSQL40', 'MYSQL40'],
                ],
            ],
            'valid values 7' => [
                [
                    ['format', 'ods', 'ods'],
                    ['sql_compatibility', 'MSSQL', 'MSSQL'],
                ],
            ],
            'valid values 8' => [
                [
                    ['format', 'odt', 'odt'],
                    ['sql_compatibility', 'ORACLE', 'ORACLE'],
                ],
            ],
            'valid values 9' => [
                [
                    ['format', 'pdf', 'pdf'],
                    ['sql_compatibility', 'TRADITIONAL', 'TRADITIONAL'],
                ],
            ],
            'valid values 10' => [[['format', 'sql', 'sql']]],
            'valid values 11' => [[['format', 'texytext', 'texytext']]],
            'valid values 12' => [[['format', 'xml', 'xml']]],
            'valid values 13' => [[['format', 'yaml', 'yaml']]],
            'valid values with type coercion' => [
                [
                    ['lock_tables', 1, true],
                    ['as_separate_files', 1, true],
                    ['asfile', 0, false],
                    ['charset', 1234, '1234'],
                    ['onserver', 1, true],
                    ['onserver_overwrite', 1, true],
                    ['quick_export_onserver', 1, true],
                    ['quick_export_onserver_overwrite', 1, true],
                    ['remember_file_template', 0, false],
                    ['file_template_table', 1234, '1234'],
                    ['file_template_database', 1234, '1234'],
                    ['file_template_server', 1234, '1234'],
                    ['codegen_format', '1', 1],
                    ['ods_columns', 1, true],
                    ['ods_null', 1234, '1234'],
                    ['odt_columns', 0, false],
                    ['odt_relation', 0, false],
                    ['odt_comments', 0, false],
                    ['odt_mime', 0, false],
                    ['odt_null', 1234, '1234'],
                    ['htmlword_columns', 1, true],
                    ['htmlword_null', 1234, '1234'],
                    ['texytext_columns', 1, true],
                    ['texytext_null', 1234, '1234'],
                    ['csv_columns', 1, true],
                    ['csv_null', 1234, '1234'],
                    ['csv_separator', 1234, '1234'],
                    ['csv_enclosed', 1234, '1234'],
                    ['csv_escaped', 1234, '1234'],
                    ['csv_terminated', 1234, '1234'],
                    ['csv_removeCRLF', 1, true],
                    ['excel_columns', 0, false],
                    ['excel_null', 1234, '1234'],
                    ['excel_removeCRLF', 1, true],
                    ['latex_columns', 0, false],
                    ['latex_relation', 0, false],
                    ['latex_comments', 0, false],
                    ['latex_mime', 0, false],
                    ['latex_null', 1234, '1234'],
                    ['latex_caption', 0, false],
                    ['latex_structure_caption', 1234, '1234'],
                    ['latex_structure_continued_caption', 1234, '1234'],
                    ['latex_data_caption', 1234, '1234'],
                    ['latex_data_continued_caption', 1234, '1234'],
                    ['latex_data_label', 1234, '1234'],
                    ['latex_structure_label', 1234, '1234'],
                    ['mediawiki_caption', 0, false],
                    ['mediawiki_headers', 0, false],
                    ['json_pretty_print', 1, true],
                    ['json_unicode', 0, false],
                    ['sql_include_comments', 0, false],
                    ['sql_disable_fk', 1, true],
                    ['sql_views_as_tables', 1, true],
                    ['sql_metadata', 1, true],
                    ['sql_use_transaction', 0, false],
                    ['sql_create_database', 1, true],
                    ['sql_drop_database', 1, true],
                    ['sql_drop_table', 1, true],
                    ['sql_if_not_exists', 1, true],
                    ['sql_view_current_user', 1, true],
                    ['sql_or_replace_view', 1, true],
                    ['sql_procedure_function', 0, false],
                    ['sql_create_table', 0, false],
                    ['sql_create_view', 0, false],
                    ['sql_create_trigger', 0, false],
                    ['sql_auto_increment', 0, false],
                    ['sql_backquotes', 0, false],
                    ['sql_dates', 1, true],
                    ['sql_relation', 1, true],
                    ['sql_truncate', 1, true],
                    ['sql_delayed', 1, true],
                    ['sql_ignore', 1, true],
                    ['sql_utc_time', 0, false],
                    ['sql_hex_for_binary', 0, false],
                    ['sql_max_query_size', '1', 1],
                    ['sql_mime', 1, true],
                    ['sql_header_comment', 1234, '1234'],
                    ['pdf_report_title', 1234, '1234'],
                    ['xml_export_struc', 0, false],
                    ['xml_export_events', 0, false],
                    ['xml_export_functions', 0, false],
                    ['xml_export_procedures', 0, false],
                    ['xml_export_tables', 0, false],
                    ['xml_export_triggers', 0, false],
                    ['xml_export_views', 0, false],
                    ['xml_export_contents', 0, false],
                ],
            ],
            'invalid values' => [
                [
                    ['format', 'invalid', 'sql'],
                    ['method', 'invalid', 'quick'],
                    ['compression', 'invalid', 'none'],
                    ['codegen_structure_or_data', 'invalid', 'data'],
                    ['codegen_format', -1, 0],
                    ['odt_structure_or_data', 'invalid', 'structure_and_data'],
                    ['htmlword_structure_or_data', 'invalid', 'structure_and_data'],
                    ['texytext_structure_or_data', 'invalid', 'structure_and_data'],
                    ['csv_structure_or_data', 'invalid', 'data'],
                    ['excel_edition', 'invalid', 'win'],
                    ['excel_structure_or_data', 'invalid', 'data'],
                    ['latex_structure_or_data', 'invalid', 'structure_and_data'],
                    ['mediawiki_structure_or_data', 'invalid', 'data'],
                    ['ods_structure_or_data', 'invalid', 'data'],
                    ['pdf_structure_or_data', 'invalid', 'data'],
                    ['phparray_structure_or_data', 'invalid', 'data'],
                    ['json_structure_or_data', 'invalid', 'data'],
                    ['sql_structure_or_data', 'invalid', 'structure_and_data'],
                    ['sql_compatibility', 'invalid', 'NONE'],
                    ['sql_type', 'invalid', 'INSERT'],
                    ['sql_max_query_size', -1, 50000],
                    ['sql_insert_syntax', 'invalid', 'both'],
                    ['xml_structure_or_data', 'invalid', 'data'],
                    ['yaml_structure_or_data', 'invalid', 'data'],
                ],
            ],
            'invalid values 2' => [[['codegen_format', 2, 0]]],
        ];
    }
}