AbstractConnectionConfigTest::testGetPassword()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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