X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Fdbal%2Ftests%2FDoctrine%2FTests%2FDBAL%2FTypes%2FObjectTest.php;fp=vendor%2Fdoctrine%2Fdbal%2Ftests%2FDoctrine%2FTests%2FDBAL%2FTypes%2FObjectTest.php;h=d25c49ae039a6255adaa160f8e26c75e09cbf933;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fapplication_blanche.git diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php new file mode 100644 index 0000000..d25c49a --- /dev/null +++ b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php @@ -0,0 +1,56 @@ +_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); + $this->_type = Type::getType('object'); + } + + public function tearDown() + { + error_reporting(-1); // reactive all error levels + } + + public function testObjectConvertsToDatabaseValue() + { + $this->assertInternalType('string', $this->_type->convertToDatabaseValue(new \stdClass(), $this->_platform)); + } + + public function testObjectConvertsToPHPValue() + { + $this->assertInternalType('object', $this->_type->convertToPHPValue(serialize(new \stdClass), $this->_platform)); + } + + public function testConversionFailure() + { + error_reporting( (E_ALL | E_STRICT) - \E_NOTICE ); + $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); + $this->_type->convertToPHPValue('abcdefg', $this->_platform); + } + + public function testNullConversion() + { + $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); + } + + /** + * @group DBAL-73 + */ + public function testFalseConversion() + { + $this->assertFalse($this->_type->convertToPHPValue(serialize(false), $this->_platform)); + } +} \ No newline at end of file