@@ 12-21 (lines=10) @@ | ||
9 | * @param string $text |
|
10 | * @param string $expected |
|
11 | */ |
|
12 | public function testParseDatatypes($text, $expected) |
|
13 | { |
|
14 | $stream = $this->makeStream($text); |
|
15 | $collation = new CollationInfo(); |
|
16 | ||
17 | $column = new ColumnDefinition(); |
|
18 | $column->parse($stream); |
|
19 | ||
20 | $this->assertSame($expected, $column->toString($collation)); |
|
21 | } |
|
22 | ||
23 | /** |
|
24 | * @return array |
|
@@ 430-440 (lines=11) @@ | ||
427 | * @param string $expected |
|
428 | * @dataProvider applyTableCollationEffectOnColumnTypeProvider |
|
429 | */ |
|
430 | public function testApplyTableCollationEffectOnColumnType($text, $expected) |
|
431 | { |
|
432 | $stream = $this->makeStream($text); |
|
433 | $column = new ColumnDefinition(); |
|
434 | $column->parse($stream); |
|
435 | ||
436 | $collation = new CollationInfo("binary"); |
|
437 | $column->applyTableCollation($collation); |
|
438 | ||
439 | $this->assertSame($expected, $column->type); |
|
440 | } |
|
441 | ||
442 | /** |
|
443 | * @return array |
@@ 14-22 (lines=9) @@ | ||
11 | * @param string $engine |
|
12 | * @param string $expected |
|
13 | */ |
|
14 | public function testSetDefaultEngine($engine, $expected) |
|
15 | { |
|
16 | $stream = $this->makeStream(''); |
|
17 | $options = new TableOptions(new CollationInfo()); |
|
18 | $options->setDefaultEngine($engine); |
|
19 | $options->parse($stream); |
|
20 | ||
21 | $this->assertSame($expected, $options->toString()); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @return array |
|
@@ 40-49 (lines=10) @@ | ||
37 | * @param string $text |
|
38 | * @param string $expected |
|
39 | */ |
|
40 | public function testParse($text, $expected) |
|
41 | { |
|
42 | $stream = $this->makeStream($text); |
|
43 | ||
44 | $options = new TableOptions(new CollationInfo()); |
|
45 | $options->setDefaultEngine('InnoDB'); |
|
46 | $options->parse($stream); |
|
47 | ||
48 | $this->assertSame($expected, $options->toString()); |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * @return array |