diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66adb433..61153a39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,6 +63,11 @@ jobs: options: --name=mssql --health-cmd="/opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: + - name: Install ODBC driver. + run: | + sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list + sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 + - name: Checkout. uses: actions/checkout@v3 diff --git a/tests/Support/TestTrait.php b/tests/Support/TestTrait.php index 3f77c031..a5df7a1c 100644 --- a/tests/Support/TestTrait.php +++ b/tests/Support/TestTrait.php @@ -38,6 +38,7 @@ protected function getConnection(bool $fixture = false): PdoConnectionInterface protected static function getDb(): PdoConnectionInterface { $dsn = (new Dsn('sqlsrv', 'localhost', 'yiitest'))->asString(); + $dsn .= ';TrustServerCertificate=yes'; return new Connection( new Driver($dsn, 'SA', 'YourStrong!Passw0rd'), @@ -49,6 +50,7 @@ protected function getDsn(): string { if ($this->dsn === '') { $this->dsn = (new Dsn('sqlsrv', 'localhost', 'yiitest'))->asString(); + $this->dsn .= ';TrustServerCertificate=yes'; } return $this->dsn;