Skip to content

Commit 70894e4

Browse files
committed
Add a test case for lowercase ASC/DESC
Signed-off-by: William Desportes <williamdes@wdes.fr>
1 parent e608b33 commit 70894e4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/Components/KeyTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,24 @@ public function testParseKeyWithLengthWithoutOptionsWithOrder()
7777
), $component->columns);
7878
}
7979

80+
public function testParseKeyWithoutOptionsWithOrderLowercase()
81+
{
82+
$component = Key::parse(
83+
new Parser(),
84+
$this->getTokensList('KEY `alias_type_idx` (`alias_type` desc),')
85+
);
86+
$this->assertEquals('KEY', $component->type);
87+
$this->assertEquals('alias_type_idx', $component->name);
88+
$this->assertEquals(new OptionsArray(), $component->options);
89+
$this->assertNull($component->expr);
90+
$this->assertSame(array(
91+
array(
92+
'name' => 'alias_type',
93+
'order' => 'DESC',
94+
)
95+
), $component->columns);
96+
}
97+
8098
public function testParseKeyWithoutOptionsWithOrder()
8199
{
82100
$component = Key::parse(

0 commit comments

Comments
 (0)