CheckTypeConditionTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCanApply() 0 8 1
1
<?php
2
namespace DBFaker\Generators\Conditions;
3
4
use Doctrine\DBAL\Schema\Column;
5
use Doctrine\DBAL\Schema\Table;
6
use Doctrine\DBAL\Types\Type;
7
use PHPUnit\Framework\TestCase;
8
9
class CheckTypeConditionTest extends TestCase
10
{
11
    public function testCanApply(){
12
        $table = new Table("foo");
13
        $column = new Column("bar", Type::getType(Type::DECIMAL));
14
15
        $checkDecimalTypeCondition = new CheckTypeCondition(Type::getType(Type::DECIMAL));
16
        $checkTextTypeCondition = new CheckTypeCondition(Type::getType(Type::TEXT));
17
        $this->assertTrue($checkDecimalTypeCondition->canApply($table, $column));
18
        $this->assertFalse($checkTextTypeCondition->canApply($table, $column));
19
    }
20
}
21