From 48078e38f317b9d7d8739315778b3b86100cd976 Mon Sep 17 00:00:00 2001 From: Adalbert Makarovych Date: Tue, 12 Dec 2023 14:15:46 +0000 Subject: [PATCH] Fixed test --- tests/Hybrid/Json/JsonUpdateTest.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/Hybrid/Json/JsonUpdateTest.php b/tests/Hybrid/Json/JsonUpdateTest.php index 9d78696..91f91bd 100644 --- a/tests/Hybrid/Json/JsonUpdateTest.php +++ b/tests/Hybrid/Json/JsonUpdateTest.php @@ -2,6 +2,7 @@ namespace SingleStore\Laravel\Tests\Hybrid\Json; +use Illuminate\Foundation\Application; use Illuminate\Support\Facades\DB; use SingleStore\Laravel\Tests\BaseTest; use SingleStore\Laravel\Tests\Hybrid\HybridTestHelpers; @@ -97,10 +98,19 @@ public function set_double_syntax() ]); }); - $this->assertEquals( - "update `test` set data = JSON_SET_JSON(data, 'value1', ?)", - $logs['query'] - ); + if (version_compare(Application::VERSION, '10.30.0', '>=')) { + // Laravel version >= 10.30.0 + $this->assertEquals( + "update `test` set data = JSON_SET_JSON(data, 'value1', 1.3)", + $logs['query'] + ); + } else { + // Laravel version < 10.30.0 + $this->assertEquals( + "update `test` set data = JSON_SET_JSON(data, 'value1', ?)", + $logs['query'] + ); + } $this->assertSame(1.3, $logs['bindings'][0]); }