Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
AdalbertMemSQL committed Dec 12, 2023
1 parent 42f409e commit 48078e3
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tests/Hybrid/Json/JsonUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
}
Expand Down

0 comments on commit 48078e3

Please sign in to comment.