Adding valid options for sqlite collation. Tests added.

This commit is contained in:
mark_story 2009-10-29 02:03:50 -04:00
parent a33457155f
commit 23831546b5
2 changed files with 22 additions and 1 deletions

View file

@ -114,7 +114,16 @@ class DboSqlite extends DboSource {
* @access public
*/
var $fieldParameters = array(
'collate' => array('value' => 'COLLATE', 'quote' => false, 'join' => ' ', 'column' => 'Collate', 'position' => 'afterDefault'),
'collate' => array(
'value' => 'COLLATE',
'quote' => false,
'join' => ' ',
'column' => 'Collate',
'position' => 'afterDefault',
'options' => array(
'BINARY', 'NOCASE', 'RTRIM'
)
),
);
/**

View file

@ -280,6 +280,18 @@ class DboSqliteTest extends CakeTestCase {
$result = $this->db->buildColumn($data);
$expected = '"testName" integer(10) DEFAULT \'10\' NOT NULL';
$this->assertEqual($result, $expected);
$data = array(
'name' => 'testName',
'type' => 'integer',
'length' => 10,
'default' => 10,
'null' => false,
'collate' => 'BADVALUE'
);
$result = $this->db->buildColumn($data);
$expected = '"testName" integer(10) DEFAULT \'10\' NOT NULL';
$this->assertEqual($result, $expected);
}
/**