Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added tests for bigints

  • Loading branch information...
commit ec35e3158c20a489a53f8ae105ea284601c63d48 1 parent 68116f7
Tommy MacWilliam tmacwill authored markstory committed
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
11 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
View
@@ -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(
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.