Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / dbal / tests / Doctrine / Tests / DBAL / Types / FloatTest.php
1 <?php
2
3 namespace Doctrine\Tests\DBAL\Types;
4
5 use Doctrine\DBAL\Types\Type;
6 use Doctrine\Tests\DBAL\Mocks;
7
8 require_once __DIR__ . '/../../TestInit.php';
9
10 class FloatTest extends \Doctrine\Tests\DbalTestCase
11 {
12     protected $_platform, $_type;
13
14     protected function setUp()
15     {
16         $this->_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform();
17         $this->_type = Type::getType('float');
18     }
19
20     public function testFloatConvertsToPHPValue()
21     {
22         $this->assertInternalType('float', $this->_type->convertToPHPValue('5.5', $this->_platform));
23     }
24
25     public function testFloatNullConvertsToPHPValue()
26     {
27         $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform));
28     }
29
30     public function testFloatConvertToDatabaseValue()
31     {
32         $this->assertInternalType('float', $this->_type->convertToDatabaseValue(5.5, $this->_platform));
33     }
34
35     public function testFloatNullConvertToDatabaseValue()
36     {
37         $this->assertNull($this->_type->convertToDatabaseValue(null, $this->_platform));
38     }
39 }