Passed
Push — master ( a506e2...902f0a )
by Joao
05:33 queued 11s
created

SqlServerDatabaseTest::getExpectedUsersVersion1()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
use ByJG\DbMigration\Database\DblibDatabase;
4
use ByJG\DbMigration\Migration;
5
use ByJG\Util\Uri;
6
7
require_once 'BaseDatabase.php';
8
9
/**
10
 * @requires extension pdo_dblib
11
 */
12
class SqlServerDatabaseTest extends BaseDatabase
13
{
14
    /**
15
     * @var Migration
16
     */
17
    protected $migrate = null;
18
19
    public function getExpectedUsersVersion1()
20
    {
21
        return [
22
            ["id" => 1, "name" => 'John Doe', 'createdate' => 'Jan 10 2016 12:00:00:AM'],
23
            ["id" => 2, "name" => 'Jane Doe', 'createdate' => 'Dec 30 2015 12:00:00:AM']
24
        ];
25
    }
26
27
    public function setUp()
28
    {
29
        $host = getenv('MSSQL_TEST_HOST');
30
        if (empty($host)) {
31
            $host = "127.0.0.1";
32
        }
33
        $password = getenv('MSSQL_PASSWORD');
34
        if (empty($password)) {
35
            $password = 'Pa55word';
36
        }
37
38
        $uri = "dblib://sa:${password}@${host}/migratedatabase";
39
40
        $this->migrate = new Migration(new Uri($uri), __DIR__ . '/../example/sql_server', true, $this->migrationTable);
41
        $this->migrate->registerDatabase("dblib", DblibDatabase::class);
42
        parent::setUp();
43
    }
44
}
45