Skip to content

Commit

Permalink
Adding more test cases for withStatements
Browse files Browse the repository at this point in the history
Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
  • Loading branch information
iifawzi committed Dec 5, 2021
1 parent f56b027 commit e979de9
Show file tree
Hide file tree
Showing 19 changed files with 12,594 additions and 1,280 deletions.
26 changes: 26 additions & 0 deletions tests/Parser/WithStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@

class WithStatementTest extends TestCase
{
/**
* @param mixed $test
*
* @dataProvider parseWith
*/
public function testParse($test): void
{
$this->runParserTest($test);
}

public function parseWith(): array
{
return [
['parser/parseWithStatement'],
['parser/parseWithStatement1'],
['parser/parseWithStatement2'],
['parser/parseWithStatement3'],
['parser/parseWithStatementErr'],
['parser/parseWithStatementErr1'],
['parser/parseWithStatementErr2'],
['parser/parseWithStatementErr3'],
['parser/parseWithStatementErr4'],
['parser/parseWithStatementErr5'],
];
}

public function testWith(): void
{
$sql = <<<SQL
Expand Down
1 change: 1 addition & 0 deletions tests/data/parser/parseWithStatement1.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE table table_name WITH cte (col1) AS ( SELECT 1 UNION ALL SELECT 2 ) SELECT col1 FROM cte
Loading

0 comments on commit e979de9

Please sign in to comment.