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

DirectForeignKeyMethodDescriptorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetForeignKey() 0 9 1
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