Passed
Pull Request — master (#14)
by Alexander
11:30
created

ConnectionTest::testDsnHelper()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Mysql\Tests;
6
7
use Yiisoft\Db\Drivers\Connection;
8
use Yiisoft\Db\Helper\Dsn;
9
use Yiisoft\Db\Tests\ConnectionTest as AbstractConnectionTest;
10
11
class ConnectionTest extends AbstractConnectionTest
12
{
13
    protected ?string $driverName = 'mysql';
14
15
    public function testDsnHelper(): void
16
    {
17
        $dsn = new Dsn('mysql', '127.0.0.1', 'yiitest', '3306');
18
19
        $connection = new Connection($this->cache, $this->logger, $this->profiler, $dsn->getDsn());
20
21
        $this->assertEquals('mysql:host=127.0.0.1;dbname=yiitest;port=3306', $connection->getDsn());
22
    }
23
}
24