mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-09 07:24:55 +02:00
21 lines
596 B
PHP
21 lines
596 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, 'user', '1234');
|
|
$connection = new DatabaseConnection($config);
|
|
|
|
$this->assertSame('user:1234@localhost:3306', $connection->getDsn());
|
|
}
|
|
}
|