/** * test column definition */ public function test_column_definition() { $expected = '"age" varchar(255)'; $this->assertEquals($expected, $this->adapter->column_definition("age", "string")); $expected = '"age" varchar(32)'; $this->assertEquals($expected, $this->adapter->column_definition("age", "string", array('limit' => 32))); $expected = '"age" varchar(32) NOT NULL'; $this->assertEquals($expected, $this->adapter->column_definition("age", "string", array('limit' => 32, 'null' => false))); $expected = '"age" varchar(32) DEFAULT \'abc\' NOT NULL'; $this->assertEquals($expected, $this->adapter->column_definition("age", "string", array('limit' => 32, 'default' => 'abc', 'null' => false))); $expected = '"age" varchar(32) DEFAULT \'abc\''; $this->assertEquals($expected, $this->adapter->column_definition("age", "string", array('limit' => 32, 'default' => 'abc'))); $expected = '"age" integer'; $this->assertEquals($expected, $this->adapter->column_definition("age", "integer")); $expected = '"age" integer'; $this->assertEquals($expected, $this->adapter->column_definition("age", "mediuminteger")); $expected = '"weight" smallint(1)'; $this->assertEquals($expected, $this->adapter->column_definition("weight", "tinyinteger", array('limit' => 1))); $expected = '"active" boolean'; $this->assertEquals($expected, $this->adapter->column_definition("active", "boolean")); $expected = '"weight" bigint'; $this->assertEquals($expected, $this->adapter->column_definition("weight", "biginteger")); $expected = '"age" text'; $this->assertEquals($expected, $this->adapter->column_definition("age", "tinytext")); $expected = '"age" bytea'; $this->assertEquals($expected, $this->adapter->column_definition("age", "longbinary")); }