|
5 | 5 | namespace PhpMyAdmin\SqlParser\Tests\Lexer;
|
6 | 6 |
|
7 | 7 | use PhpMyAdmin\SqlParser\Context;
|
| 8 | +use PhpMyAdmin\SqlParser\Contexts; |
8 | 9 | use PhpMyAdmin\SqlParser\Tests\TestCase;
|
9 | 10 | use Throwable;
|
10 | 11 |
|
@@ -110,10 +111,73 @@ public static function contextNamesProvider(): array
|
110 | 111 | ['MySql50600'],
|
111 | 112 | ['MySql50700'],
|
112 | 113 | ['MySql80000'],
|
| 114 | + ['MySql80100'], |
| 115 | + ['MySql80200'], |
| 116 | + ['MySql80300'], |
113 | 117 | ['MariaDb100000'],
|
114 | 118 | ['MariaDb100100'],
|
115 | 119 | ['MariaDb100200'],
|
116 | 120 | ['MariaDb100300'],
|
| 121 | + ['MariaDb100400'], |
| 122 | + ['MariaDb100500'], |
| 123 | + ['MariaDb100600'], |
| 124 | + ['MariaDb100700'], |
| 125 | + ['MariaDb100800'], |
| 126 | + ['MariaDb100900'], |
| 127 | + ['MariaDb101000'], |
| 128 | + ['MariaDb101100'], |
| 129 | + ['MariaDb110000'], |
| 130 | + ['MariaDb110100'], |
| 131 | + ['MariaDb110200'], |
| 132 | + ['MariaDb110300'], |
| 133 | + ['MariaDb110400'], |
| 134 | + ]; |
| 135 | + } |
| 136 | + |
| 137 | + /** |
| 138 | + * @dataProvider contextClassesProvider |
| 139 | + */ |
| 140 | + public function testLoadAllByClass(string $context): void |
| 141 | + { |
| 142 | + Context::load($context); |
| 143 | + $this->assertEquals('\\' . $context, Context::$loadedContext); |
| 144 | + |
| 145 | + // Restoring context. |
| 146 | + Context::load(''); |
| 147 | + } |
| 148 | + |
| 149 | + /** |
| 150 | + * @return string[][] |
| 151 | + */ |
| 152 | + public function contextClassesProvider(): array |
| 153 | + { |
| 154 | + return [ |
| 155 | + [Contexts\ContextMySql50000::class], |
| 156 | + [Contexts\ContextMySql50100::class], |
| 157 | + [Contexts\ContextMySql50500::class], |
| 158 | + [Contexts\ContextMySql50600::class], |
| 159 | + [Contexts\ContextMySql50700::class], |
| 160 | + [Contexts\ContextMySql80000::class], |
| 161 | + [Contexts\ContextMySql80100::class], |
| 162 | + [Contexts\ContextMySql80200::class], |
| 163 | + [Contexts\ContextMySql80300::class], |
| 164 | + [Contexts\ContextMariaDb100000::class], |
| 165 | + [Contexts\ContextMariaDb100100::class], |
| 166 | + [Contexts\ContextMariaDb100200::class], |
| 167 | + [Contexts\ContextMariaDb100300::class], |
| 168 | + [Contexts\ContextMariaDb100400::class], |
| 169 | + [Contexts\ContextMariaDb100500::class], |
| 170 | + [Contexts\ContextMariaDb100600::class], |
| 171 | + [Contexts\ContextMariaDb100700::class], |
| 172 | + [Contexts\ContextMariaDb100800::class], |
| 173 | + [Contexts\ContextMariaDb100900::class], |
| 174 | + [Contexts\ContextMariaDb101000::class], |
| 175 | + [Contexts\ContextMariaDb101100::class], |
| 176 | + [Contexts\ContextMariaDb110000::class], |
| 177 | + [Contexts\ContextMariaDb110100::class], |
| 178 | + [Contexts\ContextMariaDb110200::class], |
| 179 | + [Contexts\ContextMariaDb110300::class], |
| 180 | + [Contexts\ContextMariaDb110400::class], |
117 | 181 | ];
|
118 | 182 | }
|
119 | 183 |
|
|
0 commit comments