Skip to content

Commit 7da0660

Browse files
committed
Update RunMigrationsCommantTest.php
1 parent eabdd33 commit 7da0660

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/webfiori/framework/test/cli/RunMigrationsCommantTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ public function testRunMigrations02() {
8585
* @test
8686
*/
8787
public function testRunMigrations03() {
88-
$conn = new ConnectionInfo('mssql', SQL_SERVER_USER, 'x123456', SQL_SERVER_DB);
88+
$conn = new ConnectionInfo('mssql', SQL_SERVER_USER, 'x123456', SQL_SERVER_DB, 1433, [
89+
'TrustServerCertificate' => 'true'
90+
]);
8991
$conn->setName('default-conn');
9092
$clazz = $this->createMigration('PO', 'MyPOMigration');
9193
$this->assertTrue(class_exists($clazz));
@@ -170,6 +172,8 @@ public function testRunMigrations07() {
170172
]);
171173
$this->removeClass($clazz);
172174
App::getConfig()->removeAllDBConnections();
175+
$err = ODBC_VERSION == 17 ? "Error: Unable to connect to database: 4060 - [Microsoft][ODBC Driver ".ODBC_VERSION." for SQL Server][SQL Server]Cannot open database \"testing_dbx\" requested by the login. The login failed.\n"
176+
: "Error: Unable to connect to database: 18456 - [Microsoft][ODBC Driver ".ODBC_VERSION." for SQL Server][SQL Server]Login failed for user 'sa'.\n";
173177
$this->assertEquals([
174178
"Checking namespace '\app\database\migrations' for migrations...\n",
175179
"Info: Found 1 migration(s) in the namespace '\app\database\migrations'.\n",
@@ -178,7 +182,7 @@ public function testRunMigrations07() {
178182
"Error: Invalid answer.\n",
179183
"Select database connection:\n",
180184
"0: default-conn <--\n",
181-
"Error: Unable to connect to database: 4060 - [Microsoft][ODBC Driver ".ODBC_VERSION." for SQL Server][SQL Server]Cannot open database \"testing_dbx\" requested by the login. The login failed.\n",
185+
$err,
182186
], $output);
183187
$this->assertEquals(-1, $this->getExitCode());
184188

0 commit comments

Comments
 (0)