@@ -58,6 +58,61 @@ public function testParseKeyWithLengthWithoutOptions()
5858 ), $ component ->columns );
5959 }
6060
61+ public function testParseKeyWithLengthWithoutOptionsWithOrder ()
62+ {
63+ $ component = Key::parse (
64+ new Parser (),
65+ $ this ->getTokensList ('KEY `alias_type_idx` (`alias_type`(10) ASC), ' )
66+ );
67+ $ this ->assertEquals ('KEY ' , $ component ->type );
68+ $ this ->assertEquals ('alias_type_idx ' , $ component ->name );
69+ $ this ->assertEquals (new OptionsArray (), $ component ->options );
70+ $ this ->assertNull ($ component ->expr );
71+ $ this ->assertSame (array (
72+ array (
73+ 'name ' => 'alias_type ' ,
74+ 'length ' => 10 ,
75+ 'order ' => 'ASC ' ,
76+ )
77+ ), $ component ->columns );
78+ }
79+
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+
98+ public function testParseKeyWithoutOptionsWithOrder ()
99+ {
100+ $ component = Key::parse (
101+ new Parser (),
102+ $ this ->getTokensList ('KEY `alias_type_idx` (`alias_type` DESC), ' )
103+ );
104+ $ this ->assertEquals ('KEY ' , $ component ->type );
105+ $ this ->assertEquals ('alias_type_idx ' , $ component ->name );
106+ $ this ->assertEquals (new OptionsArray (), $ component ->options );
107+ $ this ->assertNull ($ component ->expr );
108+ $ this ->assertSame (array (
109+ array (
110+ 'name ' => 'alias_type ' ,
111+ 'order ' => 'DESC ' ,
112+ )
113+ ), $ component ->columns );
114+ }
115+
61116 public function testParseKeyWithLengthWithOptions ()
62117 {
63118 $ component = Key::parse (
0 commit comments