AbstractDmsFactoryTest::testCreateDmsDatabase()   A
last analyzed

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
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Janisbiz\LightOrm\Tests\Unit\Generator;
4
5
use Janisbiz\LightOrm\Connection\ConnectionInterface;
6
use Janisbiz\LightOrm\Generator\AbstractDmsFactory;
7
use Janisbiz\LightOrm\Generator\Dms\DmsDatabaseInterface;
8
use PHPUnit\Framework\TestCase;
9
10
class AbstractDmsFactoryTest extends TestCase
11
{
12
    /**
13
     * @var AbstractDmsFactory
14
     */
15
    private $abstractDmsFactory;
16
17
    public function setUp()
18
    {
19
        $this->abstractDmsFactory = $this->getMockForAbstractClass(AbstractDmsFactory::class);
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getMockForAbstrac...tractDmsFactory::class) of type PHPUnit\Framework\MockObject\MockObject is incompatible with the declared type Janisbiz\LightOrm\Generator\AbstractDmsFactory of property $abstractDmsFactory.

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...
20
        $this->abstractDmsFactory
21
            ->expects($this->any())
22
            ->method('createDmsDatabase')
23
            ->willReturn($this->createMock(DmsDatabaseInterface::class))
24
        ;
25
    }
26
27
    public function testCreateDmsDatabase()
28
    {
29
        /** @var ConnectionInterface $connection */
30
        $connection = $this->createMock(ConnectionInterface::class);
31
        $dmsDatabase = $this->abstractDmsFactory->createDmsDatabase('test', $connection);
32
33
        $this->assertTrue($dmsDatabase instanceof DmsDatabaseInterface);
34
    }
35
}
36