Skip to content

Commit

Permalink
added tests for bigints
Browse files Browse the repository at this point in the history
  • Loading branch information
tmacwill authored and markstory committed Aug 30, 2012
1 parent 68116f7 commit ec35e31
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
Expand Up @@ -268,6 +268,13 @@ public function testIndexDetection() {
$this->Dbo->rawQuery('DROP TABLE ' . $name);
$this->assertEquals($expected, $result);

$name = $this->Dbo->fullTableName('bigint');
$this->Dbo->rawQuery('CREATE TABLE ' . $name . ' (id bigint(20) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id));');
$expected = array('PRIMARY' => array('column' => 'id', 'unique' => 1));
$result = $this->Dbo->index('bigint', false);
$this->Dbo->rawQuery('DROP TABLE ' . $name);
$this->assertEquals($expected, $result);

$name = $this->Dbo->fullTableName('with_a_key');
$this->Dbo->rawQuery('CREATE TABLE ' . $name . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id), KEY `pointless_bool` ( `bool` ));');
$expected = array(
Expand Down Expand Up @@ -477,6 +484,10 @@ public function testColumn() {
$expected = 'integer';
$this->assertEquals($expected, $result);

$result = $this->Dbo->column('bigint(20)');
$expected = 'biginteger';
$this->assertEquals($expected, $result);

$result = $this->Dbo->column('tinyint(1)');
$expected = 'boolean';
$this->assertEquals($expected, $result);
Expand Down

0 comments on commit ec35e31

Please sign in to comment.