Skip to content
This repository
Browse code

added tests for bigints

  • Loading branch information...
commit ec35e3158c20a489a53f8ae105ea284601c63d48 1 parent 68116f7
Tommy MacWilliam authored August 27, 2012 markstory committed August 30, 2012
11  lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
@@ -268,6 +268,13 @@ public function testIndexDetection() {
268 268
 		$this->Dbo->rawQuery('DROP TABLE ' . $name);
269 269
 		$this->assertEquals($expected, $result);
270 270
 
  271
+		$name = $this->Dbo->fullTableName('bigint');
  272
+		$this->Dbo->rawQuery('CREATE TABLE ' . $name . ' (id bigint(20) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id));');
  273
+		$expected = array('PRIMARY' => array('column' => 'id', 'unique' => 1));
  274
+		$result = $this->Dbo->index('bigint', false);
  275
+		$this->Dbo->rawQuery('DROP TABLE ' . $name);
  276
+		$this->assertEquals($expected, $result);
  277
+
271 278
 		$name = $this->Dbo->fullTableName('with_a_key');
272 279
 		$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` ));');
273 280
 		$expected = array(
@@ -477,6 +484,10 @@ public function testColumn() {
477 484
 		$expected = 'integer';
478 485
 		$this->assertEquals($expected, $result);
479 486
 
  487
+		$result = $this->Dbo->column('bigint(20)');
  488
+		$expected = 'biginteger';
  489
+		$this->assertEquals($expected, $result);
  490
+
480 491
 		$result = $this->Dbo->column('tinyint(1)');
481 492
 		$expected = 'boolean';
482 493
 		$this->assertEquals($expected, $result);

0 notes on commit ec35e31

Please sign in to comment.
Something went wrong with that request. Please try again.