-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathSqlServerDblibDatabaseTest.php
52 lines (41 loc) · 1.26 KB
/
SqlServerDblibDatabaseTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace Tests;
use ByJG\DbMigration\Database\DblibDatabase;
use ByJG\DbMigration\Migration;
use ByJG\Util\Uri;
/**
* @requires extension pdo_dblib
*/
class SqlServerDblibDatabaseTest extends BaseDatabase
{
/**
* @var Migration|null
*/
protected ?Migration $migrate = null;
protected string $scheme = "dblib";
public function setUp(): void
{
$host = getenv('MSSQL_TEST_HOST');
if (empty($host)) {
$host = "127.0.0.1";
}
$password = getenv('MSSQL_PASSWORD');
if (empty($password)) {
$password = 'Pa55word';
}
$uri = $this->scheme . "://sa:{$password}@{$host}/migratedatabase";
Migration::registerDatabase(DblibDatabase::class);
$this->migrate = new Migration(new Uri($uri), __DIR__ . '/../example/sql_server', true, $this->migrationTable);
parent::setUp();
}
public function getExpectedUsersVersion1(): array
{
if ($this->scheme == "sqlsrv") {
return parent::getExpectedUsersVersion1();
}
return [
["id" => 1, "name" => 'John Doe', 'createdate' => '2016-01-10 00:00:00'],
["id" => 2, "name" => 'Jane Doe', 'createdate' => '2015-12-30 00:00:00']
];
}
}