Passed
Pull Request — master (#116)
by David
03:39
created

testGetForeignKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace TheCodingMachine\TDBM\Utils;
4
5
6
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
7
use Doctrine\DBAL\Schema\Table;
8
use PHPUnit\Framework\TestCase;
9
10
class DirectForeignKeyMethodDescriptorTest extends TestCase
11
{
12
    public function testGetForeignKey()
13
    {
14
        $fk = $this->createMock(ForeignKeyConstraint::class);
15
        $table = $this->createMock(Table::class);
16
        $ns = $this->createMock(DefaultNamingStrategy::class);
17
        $descriptor = new DirectForeignKeyMethodDescriptor($fk, $table, $ns);
18
19
        $this->assertSame($fk, $descriptor->getForeignKey());
20
        $this->assertSame($table, $descriptor->getMainTable());
21
    }
22
}
23