CheckTypeConditionTest::testCanApply()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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