Completed
Push — master ( 523298...58621f )
by smiley
02:46
created

TestAbstract::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
/**
3
 * Class TestAbstract
4
 *
5
 * @filesource   TestAbstract.php
6
 * @created      29.05.2017
7
 * @package      chillerlan\DatabaseTest
8
 * @author       Smiley <[email protected]>
9
 * @copyright    2017 Smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\DatabaseTest;
14
15
use chillerlan\Database\DBOptions;
16
use Dotenv\Dotenv;
17
use PHPUnit\Framework\TestCase;
18
19
abstract class TestAbstract extends TestCase{
20
21
	/**
22
	 * @var \chillerlan\Database\DBOptions
23
	 */
24
	protected $dbOptions;
25
26
	protected $envVar;
27
28
	protected function setUp(){
29
30
		(new Dotenv(__DIR__.'/../config', '.env'))->load();
31
32
		$this->dbOptions = new DBOptions([
33
			'host'     => getenv($this->envVar.'HOST'),
34
			'port'     => getenv($this->envVar.'PORT'),
35
			'socket'   => getenv($this->envVar.'SOCKET'),
36
			'database' => getenv($this->envVar.'DATABASE'),
37
			'username' => getenv($this->envVar.'USERNAME'),
38
			'password' => getenv($this->envVar.'PASSWORD'),
39
		]);
40
	}
41
42
}
43