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