db2 driver updates
This commit is contained in:
@@ -30,7 +30,7 @@ abstract class Db2TestCase extends TestCase
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
$this->markTestSkipped(
|
||||
'Db2 connection unavailable: ' . $e->getMessage()
|
||||
'Db2 connection unavailable: '.$e->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace Tests\Feature\Db2;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class NullHandlingTest extends Db2TestCase
|
||||
{
|
||||
private string $fixtureTable = '';
|
||||
@@ -14,7 +12,7 @@ class NullHandlingTest extends Db2TestCase
|
||||
|
||||
// Each test owns a unique permanent table.
|
||||
// Db2 catalog metadata can discover its columns.
|
||||
$this->fixtureTable = 'DB2_TEST.DB2T_' .
|
||||
$this->fixtureTable = 'DB2_TEST.DB2T_'.
|
||||
strtoupper(bin2hex(random_bytes(6)));
|
||||
|
||||
$db = $this->db();
|
||||
|
||||
@@ -10,7 +10,7 @@ class PaginationIdentityTest extends Db2TestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->tableName = 'DB2_TEST.DB2T_' .
|
||||
$this->tableName = 'DB2_TEST.DB2T_'.
|
||||
strtoupper(bin2hex(random_bytes(6)));
|
||||
|
||||
$this->db()->statement("
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Tests\Feature\Db2;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class QueryCompatibilityTest extends Db2TestCase
|
||||
{
|
||||
private ?string $table = null;
|
||||
@@ -77,7 +79,8 @@ class QueryCompatibilityTest extends Db2TestCase
|
||||
|
||||
public function test_eloquent_casts_db2_timestamps_for_security_settings(): void
|
||||
{
|
||||
$model = new class extends \Illuminate\Database\Eloquent\Model {
|
||||
$model = new class extends Model
|
||||
{
|
||||
protected $casts = ['CREATED_AT' => 'datetime', 'LAST_USED_AT' => 'datetime'];
|
||||
};
|
||||
$model->setConnection('db2_local')->setTable($this->table);
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Tests\Feature\Db2;
|
||||
|
||||
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
|
||||
use Illuminate\Database\Migrations\Migrator;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class SchemaTest extends Db2TestCase
|
||||
@@ -104,8 +106,8 @@ class SchemaTest extends Db2TestCase
|
||||
$db = $this->db();
|
||||
$schema = $db->getSchemaBuilder();
|
||||
$table = 'stage5_'.bin2hex(random_bytes(6));
|
||||
$repository = new \Illuminate\Database\Migrations\DatabaseMigrationRepository(app('db'), $table.'_history');
|
||||
$migrator = new \Illuminate\Database\Migrations\Migrator($repository, app('db'), app('files'), app('events'));
|
||||
$repository = new DatabaseMigrationRepository(app('db'), $table.'_history');
|
||||
$migrator = new Migrator($repository, app('db'), app('files'), app('events'));
|
||||
config(['stage5.table' => $table]);
|
||||
$file = base_path('tests/Fixtures/Db2/2026_01_01_000000_stage5_schema.php');
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class TransactionTest extends Db2TestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->tableName = 'DB2_TEST.DB2T_' .
|
||||
$this->tableName = 'DB2_TEST.DB2T_'.
|
||||
strtoupper(bin2hex(random_bytes(6)));
|
||||
|
||||
$this->db()->statement("
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Tests\Feature\Db2;
|
||||
|
||||
use Illuminate\Database\QueryException;
|
||||
|
||||
class UpsertTest extends Db2TestCase
|
||||
{
|
||||
private string $tableName = '';
|
||||
@@ -10,7 +12,7 @@ class UpsertTest extends Db2TestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->tableName = 'DB2_TEST.DB2T_' .
|
||||
$this->tableName = 'DB2_TEST.DB2T_'.
|
||||
strtoupper(bin2hex(random_bytes(6)));
|
||||
|
||||
$this->db()->statement("
|
||||
@@ -216,7 +218,7 @@ class UpsertTest extends Db2TestCase
|
||||
public function test_insert_or_ignore_does_not_hide_check_violations(): void
|
||||
{
|
||||
$this->expectException(
|
||||
\Illuminate\Database\QueryException::class
|
||||
QueryException::class
|
||||
);
|
||||
|
||||
$this->db()->table($this->tableName)->insertOrIgnore([
|
||||
|
||||
Reference in New Issue
Block a user