for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Class TestAbstract
*
* @filesource TestAbstract.php
* @created 29.05.2017
* @package chillerlan\DatabaseTest
* @author Smiley <[email protected]>
* @copyright 2017 Smiley
* @license MIT
*/
namespace chillerlan\DatabaseTest;
use chillerlan\Database\DBOptions;
use Dotenv\Dotenv;
use PHPUnit\Framework\TestCase;
abstract class TestAbstract extends TestCase{
* @var \chillerlan\Database\DBOptions
protected $dbOptions;
protected $envVar;
protected function setUp(){
(new Dotenv(__DIR__.'/../config', '.env'))->load();
$this->dbOptions = new DBOptions([
'host' => getenv($this->envVar.'HOST'),
'port' => getenv($this->envVar.'PORT'),
'socket' => getenv($this->envVar.'SOCKET'),
'database' => getenv($this->envVar.'DATABASE'),
'username' => getenv($this->envVar.'USERNAME'),
'password' => getenv($this->envVar.'PASSWORD'),
]);
}