Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / dbal / tests / Doctrine / Tests / DBAL / Types / SmallIntTest.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 SmallIntTest extends \Doctrine\Tests\DbalTestCase
11 {
12     protected
13         $_platform,
14         $_type;
15
16     protected function setUp()
17     {
18         $this->_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform();
19         $this->_type = Type::getType('smallint');
20     }
21
22     public function testSmallIntConvertsToPHPValue()
23     {
24         $this->assertInternalType('integer', $this->_type->convertToPHPValue('1', $this->_platform));
25         $this->assertInternalType('integer', $this->_type->convertToPHPValue('0', $this->_platform));
26     }
27
28     public function testSmallIntNullConvertsToPHPValue()
29     {
30         $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform));
31     }
32 }