Passed
Pull Request — 4 (#10017)
by Thomas
09:46
created

DBIntTest::testGetValueCastToInt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
namespace SilverStripe\ORM\Tests;
4
5
use SilverStripe\Dev\SapphireTest;
6
use SilverStripe\ORM\FieldType\DBInt;
7
8
class DBIntTest extends SapphireTest
9
{
10
    public function testGetValueCastToInt()
11
    {
12
        $field = DBInt::create('MyField');
13
        $field->setValue(3);
14
        $this->assertSame(3, $field->getValue());
15
        $field->setValue('3');
16
        $this->assertSame(3, $field->getValue());
17
    }
18
}
19