Skip to content

Commit

Permalink
rebase on main
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetry committed Nov 30, 2023
1 parent fea1039 commit 75c4424
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/Language/CaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare(strict_types=1);

use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Blueprint;
use Tpetry\QueryExpressions\Language\CaseGroup;
use Tpetry\QueryExpressions\Language\CaseRule;
use Tpetry\QueryExpressions\Tests\ConditionExpression;
Expand All @@ -24,7 +25,9 @@
new CaseRule(new Expression(2), new ConditionExpression('1 = 1')),
new CaseRule('val', new ConditionExpression('2 = 2')),
]))
->toBeExecutable(['val int'])
->toBeExecutable(function (Blueprint $table) {
$table->integer('val');
})
->toBeMysql('(case when 1 = 1 then 2 when 2 = 2 then `val` end)')
->toBePgsql('(case when 1 = 1 then 2 when 2 = 2 then "val" end)')
->toBeSqlite('(case when 1 = 1 then 2 when 2 = 2 then "val" end)')
Expand All @@ -38,7 +41,9 @@
],
new Expression('4'),
))
->toBeExecutable(['val int'])
->toBeExecutable(function (Blueprint $table) {
$table->integer('val');
})
->toBeMysql('(case when 1 = 1 then 2 when 2 = 2 then `val` else 4 end)')
->toBePgsql('(case when 1 = 1 then 2 when 2 = 2 then "val" else 4 end)')
->toBeSqlite('(case when 1 = 1 then 2 when 2 = 2 then "val" else 4 end)')
Expand All @@ -52,7 +57,9 @@
],
'val',
))
->toBeExecutable(['val int'])
->toBeExecutable(function (Blueprint $table) {
$table->integer('val');
})
->toBeMysql('(case when 1 = 1 then 2 when 2 = 2 then `val` else `val` end)')
->toBePgsql('(case when 1 = 1 then 2 when 2 = 2 then "val" else "val" end)')
->toBeSqlite('(case when 1 = 1 then 2 when 2 = 2 then "val" else "val" end)')
Expand Down

0 comments on commit 75c4424

Please sign in to comment.