db2 driver updates
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Db2;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Tests\TestCase;
|
||||
|
||||
abstract class Db2TestCase extends TestCase
|
||||
{
|
||||
protected function db()
|
||||
{
|
||||
return DB::connection('db2_local');
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
if (! extension_loaded('pdo_odbc')) {
|
||||
$this->markTestSkipped('PDO_ODBC extension unavailable.');
|
||||
}
|
||||
|
||||
if (! config('database.connections.db2_local')) {
|
||||
$this->markTestSkipped('db2_local is not configured.');
|
||||
}
|
||||
|
||||
try {
|
||||
$this->db()->select(
|
||||
'SELECT 1 AS "health" FROM SYSIBM.SYSDUMMY1'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
$this->markTestSkipped(
|
||||
'Db2 connection unavailable: ' . $e->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user