Rajout de doctrine/orm
[zf2.biz/application_blanche.git] / vendor / doctrine / dbal / tests / Doctrine / Tests / DBAL / Types / BooleanTest.php
diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php
new file mode 100644 (file)
index 0000000..753cfb4
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace Doctrine\Tests\DBAL\Types;
+
+use Doctrine\DBAL\Types\Type;
+use Doctrine\Tests\DBAL\Mocks;
+
+require_once __DIR__ . '/../../TestInit.php';
+
+class BooleanTest extends \Doctrine\Tests\DbalTestCase
+{
+    protected
+        $_platform,
+        $_type;
+
+    protected function setUp()
+    {
+        $this->_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform();
+        $this->_type = Type::getType('boolean');
+    }
+
+    public function testBooleanConvertsToDatabaseValue()
+    {
+        $this->assertInternalType('integer', $this->_type->convertToDatabaseValue(1, $this->_platform));
+    }
+
+    public function testBooleanConvertsToPHPValue()
+    {
+        $this->assertInternalType('bool', $this->_type->convertToPHPValue(0, $this->_platform));
+    }
+
+    public function testBooleanNullConvertsToPHPValue()
+    {
+        $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform));
+    }
+}
\ No newline at end of file