[Schema::TYPE_DATETIME . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->dateTime()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "datetime CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_DATETIME . ' NOT NULL', $this->dateTime()->notNull(), 'datetime NOT NULL'],
[Schema::TYPE_TIMESTAMP . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->timestamp()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "timestamp CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_TIMESTAMP . ' NOT NULL', $this->timestamp()->notNull(), 'timestamp NOT NULL'],
[Schema::TYPE_TIME, $this->time(), 'time'],
[Schema::TYPE_TIME . " CHECK (value BETWEEN '12:00:00' AND '13:01:01')", $this->time()->check("value BETWEEN '12:00:00' AND '13:01:01'"), "time CHECK (value BETWEEN '12:00:00' AND '13:01:01')"],
[Schema::TYPE_TIME . ' NOT NULL', $this->time()->notNull(), 'time NOT NULL'],
[Schema::TYPE_DATE, $this->date(), 'date'],
[Schema::TYPE_DATE . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->date()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "date CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_DATE . ' NOT NULL', $this->date()->notNull(), 'date NOT NULL'],
@ -161,7 +161,7 @@ class SchemaTest extends DatabaseTestCase
'defaultValue' => 1,
],
'char_col' => [
'type' => 'string',
'type' => 'char',
'dbType' => 'char(100)',
'phpType' => 'string',
'allowNull' => false,
@ -333,20 +333,20 @@ class SchemaTest extends DatabaseTestCase
foreach($table->columns as $name => $column) {
$expected = $columns[$name];
$this->assertSame($expected['dbType'], $column->dbType, "dbType of colum $name does not match. type is $column->type, dbType is $column->dbType.");
$this->assertSame($expected['phpType'], $column->phpType, "phpType of colum $name does not match. type is $column->type, dbType is $column->dbType.");
$this->assertSame($expected['type'], $column->type, "type of colum $name does not match.");
$this->assertSame($expected['allowNull'], $column->allowNull, "allowNull of colum $name does not match.");
$this->assertSame($expected['autoIncrement'], $column->autoIncrement, "autoIncrement of colum $name does not match.");
$this->assertSame($expected['enumValues'], $column->enumValues, "enumValues of colum $name does not match.");
$this->assertSame($expected['size'], $column->size, "size of colum $name does not match.");
$this->assertSame($expected['precision'], $column->precision, "precision of colum $name does not match.");
$this->assertSame($expected['scale'], $column->scale, "scale of colum $name does not match.");
$this->assertSame($expected['dbType'], $column->dbType, "dbType of column $name does not match. type is $column->type, dbType is $column->dbType.");
$this->assertSame($expected['phpType'], $column->phpType, "phpType of column $name does not match. type is $column->type, dbType is $column->dbType.");
$this->assertSame($expected['type'], $column->type, "type of column $name does not match.");
$this->assertSame($expected['allowNull'], $column->allowNull, "allowNull of column $name does not match.");
$this->assertSame($expected['autoIncrement'], $column->autoIncrement, "autoIncrement of column $name does not match.");
$this->assertSame($expected['enumValues'], $column->enumValues, "enumValues of column $name does not match.");
$this->assertSame($expected['size'], $column->size, "size of column $name does not match.");
$this->assertSame($expected['precision'], $column->precision, "precision of column $name does not match.");
$this->assertSame($expected['scale'], $column->scale, "scale of column $name does not match.");
if (is_object($expected['defaultValue'])) {
$this->assertTrue(is_object($column->defaultValue), "defaultValue of colum $name is expected to be an object but it is not.");
$this->assertEquals((string) $expected['defaultValue'], (string) $column->defaultValue, "defaultValue of colum $name does not match.");
$this->assertTrue(is_object($column->defaultValue), "defaultValue of column $name is expected to be an object but it is not.");
$this->assertEquals((string) $expected['defaultValue'], (string) $column->defaultValue, "defaultValue of column $name does not match.");
} else {
$this->assertSame($expected['defaultValue'], $column->defaultValue, "defaultValue of colum $name does not match.");
$this->assertSame($expected['defaultValue'], $column->defaultValue, "defaultValue of column $name does not match.");
[Schema::TYPE_DATETIME . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->dateTime()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "datetime CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_DATETIME . ' NOT NULL', $this->dateTime()->notNull(), 'datetime NOT NULL'],
[Schema::TYPE_TIMESTAMP . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->timestamp()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "timestamp CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_TIMESTAMP . ' NOT NULL', $this->timestamp()->notNull(), 'timestamp NOT NULL'],
[Schema::TYPE_TIME, $this->time(), 'time'],
[Schema::TYPE_TIME . " CHECK (value BETWEEN '12:00:00' AND '13:01:01')", $this->time()->check("value BETWEEN '12:00:00' AND '13:01:01'"), "time CHECK (value BETWEEN '12:00:00' AND '13:01:01')"],
[Schema::TYPE_TIME . ' NOT NULL', $this->time()->notNull(), 'time NOT NULL'],
[Schema::TYPE_DATE, $this->date(), 'date'],
[Schema::TYPE_DATE . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->date()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "date CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_DATE . ' NOT NULL', $this->date()->notNull(), 'date NOT NULL'],
[Schema::TYPE_STRING . ' CHECK (value LIKE \'test%\')', $this->string()->check('value LIKE \'test%\''), 'VARCHAR2(255) CHECK (value LIKE \'test%\')'],
[Schema::TYPE_STRING . '(32) CHECK (value LIKE \'test%\')', $this->string(32)->check('value LIKE \'test%\''), 'VARCHAR2(32) CHECK (value LIKE \'test%\')'],
[Schema::TYPE_STRING . ' NOT NULL', $this->string()->notNull(), 'VARCHAR2(255) NOT NULL'],
[Schema::TYPE_STRING . ' CHECK (value LIKE \'test%\')', $this->string()->check('value LIKE \'test%\''), 'varchar(255) CHECK (value LIKE \'test%\')'],
[Schema::TYPE_STRING . '(32) CHECK (value LIKE \'test%\')', $this->string(32)->check('value LIKE \'test%\''), 'varchar(32) CHECK (value LIKE \'test%\')'],
[Schema::TYPE_STRING . ' NOT NULL', $this->string()->notNull(), 'varchar(255) NOT NULL'],
[Schema::TYPE_DATETIME . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->dateTime()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "timestamp(0) CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_DATETIME . ' NOT NULL', $this->dateTime()->notNull(), 'timestamp(0) NOT NULL'],
[Schema::TYPE_TIMESTAMP . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->timestamp()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "timestamp(0) CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_TIMESTAMP . ' NOT NULL', $this->timestamp()->notNull(), 'timestamp(0) NOT NULL'],
[Schema::TYPE_TIME . " CHECK (value BETWEEN '12:00:00' AND '13:01:01')", $this->time()->check("value BETWEEN '12:00:00' AND '13:01:01'"), "time(0) CHECK (value BETWEEN '12:00:00' AND '13:01:01')"],
[Schema::TYPE_TIME . ' NOT NULL', $this->time()->notNull(), 'time(0) NOT NULL'],
[Schema::TYPE_DATE, $this->date(), 'date'],
[Schema::TYPE_DATE . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->date()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "date CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_DATE . ' NOT NULL', $this->date()->notNull(), 'date NOT NULL'],
[Schema::TYPE_DATETIME . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->dateTime()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "datetime CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_DATETIME . ' NOT NULL', $this->dateTime()->notNull(), 'datetime NOT NULL'],
[Schema::TYPE_TIMESTAMP . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->timestamp()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "timestamp CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_TIMESTAMP . ' NOT NULL', $this->timestamp()->notNull(), 'timestamp NOT NULL'],
[Schema::TYPE_TIME, $this->time(), 'time'],
[Schema::TYPE_TIME . " CHECK (value BETWEEN '12:00:00' AND '13:01:01')", $this->time()->check("value BETWEEN '12:00:00' AND '13:01:01'"), "time CHECK (value BETWEEN '12:00:00' AND '13:01:01')"],
[Schema::TYPE_TIME . ' NOT NULL', $this->time()->notNull(), 'time NOT NULL'],
[Schema::TYPE_DATE, $this->date(), 'date'],
[Schema::TYPE_DATE . " CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')", $this->date()->check("value BETWEEN '2011-01-01' AND '2013-01-01'"), "date CHECK (value BETWEEN '2011-01-01' AND '2013-01-01')"],
[Schema::TYPE_DATE . ' NOT NULL', $this->date()->notNull(), 'date NOT NULL'],