Files
DesignPatternsPHP/Structural/DependencyInjection/Tests/DependencyInjectionTest.php
2019-08-19 18:11:49 +02:00

19 lines
601 B
PHP

<?php declare(strict_types=1);
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->assertSame('domnikl:1234@localhost:3306', $connection->getDsn());
}
}