Files
DesignPatternsPHP/Structural/DependencyInjection/Tests/DependencyInjectionTest.php
2017-03-09 00:35:08 +01:00

19 lines
578 B
PHP

<?php
namespace DesignPatterns\Structural\DependencyInjection\Tests;
use DesignPatterns\Structural\DependencyInjection\DatabaseConfiguration;
use DesignPatterns\Structural\DependencyInjection\DatabaseConnection;
use PHPUnit\Framework\TestCase;
class DependencyInjectionTest extends TestCase
{
public function testDependencyInjection()
{
$config = new DatabaseConfiguration('localhost', 3306, 'domnikl', '1234');
$connection = new DatabaseConnection($config);
$this->assertEquals('domnikl:1234@localhost:3306', $connection->getDsn());
}
}