Passed
Push — master ( 86c63e...a506e2 )
by Joao
01:10 queued 10s
created

SqlServerDblibDatabaseTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 17 3
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 SqlServerDblibDatabaseTest extends BaseDatabase
13
{
14
    /**
15
     * @var Migration
16
     */
17
    protected $migrate = null;
18
19
    protected $scheme = "dblib";
20
21
    public function setUp()
22
    {
23
        $host = getenv('MSSQL_TEST_HOST');
24
        if (empty($host)) {
25
            $host = "127.0.0.1";
26
        }
27
        $password = getenv('MSSQL_PASSWORD');
28
        if (empty($password)) {
29
            $password = 'Pa55word';
30
        }
31
32
        $uri = $this->scheme . "://sa:${password}@${host}/migratedatabase";
33
34
        $this->migrate = new Migration(new Uri($uri), __DIR__ . '/../example/sql_server', true, $this->migrationTable);
35
        $this->migrate->registerDatabase($this->scheme, DblibDatabase::class);
36
        parent::setUp();
37
    }
38
}
39