Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

Commit 0049281

Browse files
committed
ci: 🎡 Workaround for sqlsrv
laravel/framework#47937
1 parent 08ec8d3 commit 0049281

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Test.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Mpyw\LaravelUniqueViolationDetector\Tests;
66

7+
use Illuminate\Database\Connection;
8+
use Illuminate\Database\Connectors\SqlServerConnector;
79
use Illuminate\Database\QueryException;
810
use Illuminate\Database\Schema\Blueprint;
911
use Illuminate\Database\SQLiteConnection;
@@ -40,6 +42,19 @@ protected function setUp(): void
4042
{
4143
parent::setUp();
4244

45+
// https://github.com/laravel/framework/issues/47937#issuecomment-1678200201
46+
$this->app->instance(
47+
'db.connector.sqlsrv',
48+
new class() extends SqlServerConnector {
49+
protected $options = [
50+
PDO::ATTR_CASE => PDO::CASE_NATURAL,
51+
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
52+
PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL,
53+
PDO::SQLSRV_ATTR_FETCHES_NUMERIC_TYPE => true,
54+
];
55+
},
56+
);
57+
4358
config(['database.connections' => require __DIR__ . '/config/database.php']);
4459
config(['database.default' => getenv('DB') ?: 'sqlite']);
4560

0 commit comments

Comments
 (0)