CubridSchemaTest.php 869 Bytes
Newer Older
Carsten Brandt committed
1 2 3 4 5
<?php
namespace yiiunit\framework\db\cubrid;

use yiiunit\framework\db\SchemaTest;

6 7 8 9
/**
 * @group db
 * @group cubrid
 */
Carsten Brandt committed
10 11
class CubridSchemaTest extends SchemaTest
{
12
    public $driverName = 'cubrid';
13

14 15 16 17 18 19 20 21 22 23 24 25 26
    public function testGetPDOType()
    {
        $values = [
            [null, \PDO::PARAM_NULL],
            ['', \PDO::PARAM_STR],
            ['hello', \PDO::PARAM_STR],
            [0, \PDO::PARAM_INT],
            [1, \PDO::PARAM_INT],
            [1337, \PDO::PARAM_INT],
            [true, \PDO::PARAM_INT],
            [false, \PDO::PARAM_INT],
            [$fp = fopen(__FILE__, 'rb'), \PDO::PARAM_LOB],
        ];
27

28 29
        /** @var Schema $schema */
        $schema = $this->getConnection()->schema;
30

31 32 33 34 35
        foreach ($values as $value) {
            $this->assertEquals($value[1], $schema->getPdoType($value[0]));
        }
        fclose($fp);
    }
Carsten Brandt committed
36
}