From d93dba55be383df7cfa5c8d807d2c6af04852376 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Tue, 29 Sep 2009 09:24:13 -0400 Subject: [PATCH] Fix MySQL tests to match new primary key definition --- framework/Db/test/Horde/Db/Adapter/MysqliTest.php | 8 ++++---- framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/framework/Db/test/Horde/Db/Adapter/MysqliTest.php b/framework/Db/test/Horde/Db/Adapter/MysqliTest.php index dff351b01..f4dff914f 100644 --- a/framework/Db/test/Horde/Db/Adapter/MysqliTest.php +++ b/framework/Db/test/Horde/Db/Adapter/MysqliTest.php @@ -381,9 +381,9 @@ class Horde_Db_Adapter_MysqliTest extends PHPUnit_Framework_TestCase $this->assertEquals('id', $col->getName()); $this->assertEquals('integer', $col->getType()); $this->assertEquals(false, $col->isNull()); - $this->assertEquals(11, $col->getLimit()); + $this->assertEquals(10, $col->getLimit()); $this->assertEquals('', $col->getDefault()); - $this->assertEquals('int(11)', $col->getSqlType()); + $this->assertEquals('int(10) unsigned', $col->getSqlType()); $this->assertEquals(false, $col->isText()); $this->assertEquals(true, $col->isNumber()); } @@ -673,7 +673,7 @@ class Horde_Db_Adapter_MysqliTest extends PHPUnit_Framework_TestCase $structure = $this->_conn->structureDump('sports'); $expected = "CREATE TABLE `sports` (\n". - " `id` int(11) NOT NULL AUTO_INCREMENT,\n". + " `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,\n". " `name` varchar(255) DEFAULT NULL,\n". " `is_college` tinyint(1) DEFAULT NULL,\n". " PRIMARY KEY (`id`)\n". @@ -706,7 +706,7 @@ class Horde_Db_Adapter_MysqliTest extends PHPUnit_Framework_TestCase public function testTypeToSqlTypePrimaryKey() { $result = $this->_conn->typeToSql('primaryKey'); - $this->assertEquals('int(11) DEFAULT NULL auto_increment PRIMARY KEY', $result); + $this->assertEquals('int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY', $result); } public function testTypeToSqlTypeString() diff --git a/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php b/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php index bd32a0bd0..a7df71d80 100644 --- a/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php @@ -381,9 +381,9 @@ class Horde_Db_Adapter_Pdo_MysqlTest extends PHPUnit_Framework_TestCase $this->assertEquals('id', $col->getName()); $this->assertEquals('integer', $col->getType()); $this->assertEquals(false, $col->isNull()); - $this->assertEquals(11, $col->getLimit()); + $this->assertEquals(10, $col->getLimit()); $this->assertEquals('', $col->getDefault()); - $this->assertEquals('int(11)', $col->getSqlType()); + $this->assertEquals('int(10) unsigned', $col->getSqlType()); $this->assertEquals(false, $col->isText()); $this->assertEquals(true, $col->isNumber()); } @@ -673,7 +673,7 @@ class Horde_Db_Adapter_Pdo_MysqlTest extends PHPUnit_Framework_TestCase $structure = $this->_conn->structureDump('sports'); $expected = "CREATE TABLE `sports` (\n". - " `id` int(11) NOT NULL AUTO_INCREMENT,\n". + " `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,\n". " `name` varchar(255) DEFAULT NULL,\n". " `is_college` tinyint(1) DEFAULT NULL,\n". " PRIMARY KEY (`id`)\n". @@ -706,7 +706,7 @@ class Horde_Db_Adapter_Pdo_MysqlTest extends PHPUnit_Framework_TestCase public function testTypeToSqlTypePrimaryKey() { $result = $this->_conn->typeToSql('primaryKey'); - $this->assertEquals('int(11) DEFAULT NULL auto_increment PRIMARY KEY', $result); + $this->assertEquals('int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY', $result); } public function testTypeToSqlTypeString() -- 2.11.0