3 namespace Doctrine\Tests\DBAL\Types;
5 use Doctrine\DBAL\Types\Type;
6 use Doctrine\Tests\DBAL\Mocks;
8 require_once __DIR__ . '/../../TestInit.php';
10 class FloatTest extends \Doctrine\Tests\DbalTestCase
12 protected $_platform, $_type;
14 protected function setUp()
16 $this->_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform();
17 $this->_type = Type::getType('float');
20 public function testFloatConvertsToPHPValue()
22 $this->assertInternalType('float', $this->_type->convertToPHPValue('5.5', $this->_platform));
25 public function testFloatNullConvertsToPHPValue()
27 $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform));
30 public function testFloatConvertToDatabaseValue()
32 $this->assertInternalType('float', $this->_type->convertToDatabaseValue(5.5, $this->_platform));
35 public function testFloatNullConvertToDatabaseValue()
37 $this->assertNull($this->_type->convertToDatabaseValue(null, $this->_platform));