Fixed #DDC-571
This commit is contained in:
parent
ee04b31da3
commit
dc3844e167
@ -43,7 +43,7 @@ class IntegerType extends Type
|
|||||||
|
|
||||||
public function convertToPHPValue($value, AbstractPlatform $platform)
|
public function convertToPHPValue($value, AbstractPlatform $platform)
|
||||||
{
|
{
|
||||||
return (int) $value;
|
return (null === $value) ? null : (int) $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBindingType()
|
public function getBindingType()
|
||||||
|
@ -19,10 +19,14 @@ class IntegerTest extends \Doctrine\Tests\DbalTestCase
|
|||||||
$this->_type = Type::getType('integer');
|
$this->_type = Type::getType('integer');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDecimalConvertsToPHPValue()
|
public function testIntegerConvertsToPHPValue()
|
||||||
{
|
{
|
||||||
$this->assertTrue(
|
$this->assertTrue(
|
||||||
is_integer($this->_type->convertToPHPValue('1', $this->_platform))
|
is_integer($this->_type->convertToPHPValue('1', $this->_platform))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->assertTrue(
|
||||||
|
is_null($this->_type->convertToPHPValue(null, $this->_platform))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user