update more tests, DatatypeFixture

This commit is contained in:
Sebastien Barre 2017-03-05 22:38:08 -05:00
parent c0ea3d08e6
commit 15a33eee06
3 changed files with 33 additions and 1 deletions

View file

@ -173,6 +173,9 @@ class TestAppSchema extends CakeSchema {
'float_field' => array('type' => 'float', 'null' => false, 'length' => '5,2', 'default' => ''),
'decimal_field' => array('type' => 'decimal', 'length' => '6,3', 'default' => '0.000'),
'huge_int' => array('type' => 'biginteger'),
'normal_int' => array('type' => 'integer'),
'small_int' => array('type' => 'smallint'),
'tiny_int' => array('type' => 'tinyint'),
'bool' => array('type' => 'boolean', 'null' => false, 'default' => false),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => true)),
'tableParameters' => array()

View file

@ -405,6 +405,24 @@ class SqliteTest extends CakeTestCase {
'default' => null,
'length' => 20,
),
'normal_int' => array(
'type' => 'integer',
'null' => true,
'default' => null,
'length' => null
),
'small_int' => array(
'type' => 'integer',
'null' => true,
'default' => null,
'length' => null
),
'tiny_int' => array(
'type' => 'integer',
'null' => true,
'default' => null,
'length' => null
),
'bool' => array(
'type' => 'boolean',
'null' => false,

View file

@ -33,6 +33,9 @@ class DatatypeFixture extends CakeTestFixture {
'float_field' => array('type' => 'float', 'length' => '5,2', 'null' => false, 'default' => null),
'decimal_field' => array('type' => 'decimal', 'length' => '6,3', 'default' => '0.000'),
'huge_int' => array('type' => 'biginteger'),
'normal_int' => array('type' => 'integer'),
'small_int' => array('type' => 'smallint'),
'tiny_int' => array('type' => 'tinyint'),
'bool' => array('type' => 'boolean', 'null' => false, 'default' => false),
);
@ -42,6 +45,14 @@ class DatatypeFixture extends CakeTestFixture {
* @var array
*/
public $records = array(
array('id' => 1, 'float_field' => 42.23, 'huge_int' => '1234567891234567891', 'bool' => 0),
array(
'id' => 1,
'float_field' => 42.23,
'huge_int' => '9223372036854775807',
'normal_int' => 2147483647,
'small_int' => 32767,
'tiny_int' => 127,
'bool' => 0
),
);
}