AbstractConnectionConfigTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
c 1
b 0
f 0
dl 0
loc 40
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetPassword() 0 3 1
A setUp() 0 10 1
A testGetUsername() 0 3 1
A testGetDbname() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Janisbiz\LightOrm\Tests\Unit\Connection;
4
5
use Janisbiz\LightOrm\Connection\AbstractConnectionConfig;
6
use PHPUnit\Framework\TestCase;
7
8
class AbstractConnectionConfigTest extends TestCase
9
{
10
    const CONFIG_HOST = 'host';
11
    const CONFIG_USERNAME = 'username';
12
    const CONFIG_PASSWORD = 'password';
13
    const CONFIG_DBNAME = 'dbname';
14
    const CONFIG_ADAPTER = 'adapter';
15
16
    /**
17
     * @var AbstractConnectionConfig
18
     */
19
    private $abstractConnectionConfig;
20
21
    public function setUp()
22
    {
23
        $this->abstractConnectionConfig = $this->getMockForAbstractClass(
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getMockForAbstrac...tatic::CONFIG_ADAPTER)) of type PHPUnit\Framework\MockObject\MockObject is incompatible with the declared type Janisbiz\LightOrm\Connec...bstractConnectionConfig of property $abstractConnectionConfig.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
24
            AbstractConnectionConfig::class,
25
            [
26
                static::CONFIG_HOST,
27
                static::CONFIG_USERNAME,
28
                static::CONFIG_PASSWORD,
29
                static::CONFIG_DBNAME,
30
                static::CONFIG_ADAPTER,
31
            ]
32
        );
33
    }
34
35
    public function testGetUsername()
36
    {
37
        $this->assertEquals(static::CONFIG_USERNAME, $this->abstractConnectionConfig->getUsername());
38
    }
39
40
    public function testGetPassword()
41
    {
42
        $this->assertEquals(static::CONFIG_PASSWORD, $this->abstractConnectionConfig->getPassword());
43
    }
44
45
    public function testGetDbname()
46
    {
47
        $this->assertEquals(static::CONFIG_DBNAME, $this->abstractConnectionConfig->getDbname());
48
    }
49
}
50