From a1e5fa356efd4401d5c9c273747e7a31bd0a3fdc Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Tue, 15 Oct 2013 04:53:33 +0200 Subject: [PATCH] fixed cubrid schema test for pdo type --- .../unit/framework/db/cubrid/CubridSchemaTest.php | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/unit/framework/db/cubrid/CubridSchemaTest.php b/tests/unit/framework/db/cubrid/CubridSchemaTest.php index 9a0c139..cdfe3c8 100644 --- a/tests/unit/framework/db/cubrid/CubridSchemaTest.php +++ b/tests/unit/framework/db/cubrid/CubridSchemaTest.php @@ -10,4 +10,27 @@ use yiiunit\framework\db\SchemaTest; class CubridSchemaTest extends SchemaTest { public $driverName = 'cubrid'; + + public function testGetPDOType() + { + $values = array( + array(null, \PDO::PARAM_NULL), + array('', \PDO::PARAM_STR), + array('hello', \PDO::PARAM_STR), + array(0, \PDO::PARAM_INT), + array(1, \PDO::PARAM_INT), + array(1337, \PDO::PARAM_INT), + array(true, \PDO::PARAM_INT), + array(false, \PDO::PARAM_INT), + array($fp=fopen(__FILE__, 'rb'), \PDO::PARAM_LOB), + ); + + /** @var Schema $schema */ + $schema = $this->getConnection()->schema; + + foreach($values as $value) { + $this->assertEquals($value[1], $schema->getPdoType($value[0])); + } + fclose($fp); + } }