From 75c4424da8b9d694b18f37974eb104052959da70 Mon Sep 17 00:00:00 2001 From: tpetry Date: Thu, 30 Nov 2023 09:36:35 +0100 Subject: [PATCH] rebase on main --- tests/Language/CaseTest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/Language/CaseTest.php b/tests/Language/CaseTest.php index ad01e36..a03c898 100644 --- a/tests/Language/CaseTest.php +++ b/tests/Language/CaseTest.php @@ -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; @@ -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)') @@ -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)') @@ -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)')