Completed
Push — master ( c7757e...39cb21 )
by Luís
16s
created

tests/Doctrine/Tests/DBAL/Types/FloatTest.php (1 issue)

1
<?php
2
3
namespace Doctrine\Tests\DBAL\Types;
4
5
use Doctrine\DBAL\Types\Type;
6
use Doctrine\Tests\DBAL\Mocks\MockPlatform;
7
8
class FloatTest extends \Doctrine\Tests\DbalTestCase
9
{
10
    protected $_platform, $_type;
0 ignored issues
show
It is generally advisable to only define one property per statement.

Only declaring a single property per statement allows you to later on add doc comments more easily.

It is also recommended by PSR2, so it is a common style that many people expect.

Loading history...
11
12
    protected function setUp()
13
    {
14
        $this->_platform = new MockPlatform();
15
        $this->_type = Type::getType('float');
16
    }
17
18
    public function testFloatConvertsToPHPValue()
19
    {
20
        self::assertInternalType('float', $this->_type->convertToPHPValue('5.5', $this->_platform));
21
    }
22
23
    public function testFloatNullConvertsToPHPValue()
24
    {
25
        self::assertNull($this->_type->convertToPHPValue(null, $this->_platform));
26
    }
27
28
    public function testFloatConvertToDatabaseValue()
29
    {
30
        self::assertInternalType('float', $this->_type->convertToDatabaseValue(5.5, $this->_platform));
31
    }
32
33
    public function testFloatNullConvertToDatabaseValue()
34
    {
35
        self::assertNull($this->_type->convertToDatabaseValue(null, $this->_platform));
36
    }
37
}
38