Skip to content

Commit e4842a4

Browse files
committed
feat: local tests using sqlite
DB_CONNECTION=sqlite DB_DATABASE=:memory: ./vendor/bin/phpunit
1 parent a3f9bf2 commit e4842a4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Grid/Model.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ protected function setSort()
539539
$explodedCols = explode('.', $this->sort['column']);
540540
$col = array_shift($explodedCols);
541541
$parts = implode('.', $explodedCols);
542-
$columnName = "{$col}->>'$.{$parts}'";
542+
$columnName = "JSON_EXTRACT({$col}, '$.{$parts}')";
543543
}
544544

545545
// get column. if contains "cast", set set column as cast

tests/TestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function setUp(): void
3737

3838
$adminConfig = require __DIR__.'/config/admin.php';
3939

40-
$this->app['config']->set('database.default', 'mysql');
40+
$this->app['config']->set('database.default', env('DB_CONNECTION', 'mysql'));
4141
$this->app['config']->set('database.connections.mysql.host', env('MYSQL_HOST', 'localhost'));
4242
$this->app['config']->set('database.connections.mysql.database', env('MYSQL_DATABASE', 'laravel_admin_test'));
4343
$this->app['config']->set('database.connections.mysql.username', env('MYSQL_USER', 'root'));

0 commit comments

Comments
 (0)