mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
fix tests, add numeric type for unsigned
This commit is contained in:
parent
5a40944a6f
commit
e35823e72a
2 changed files with 24 additions and 16 deletions
|
@ -91,7 +91,7 @@ class Mysql extends DboSource {
|
|||
'value' => 'UNSIGNED', 'quote' => false, 'join' => ' ', 'column' => false, 'position' => 'afterDefault',
|
||||
'noVal' => true,
|
||||
'options' => array(true),
|
||||
'types' => array('integer', 'float', 'biginteger')
|
||||
'types' => array('integer', 'float', 'biginteger', 'numeric')
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -3166,14 +3166,9 @@ class MysqlTest extends CakeTestCase {
|
|||
*
|
||||
* @dataProvider buildColumnUnsignedProvider
|
||||
*/
|
||||
public function testBuildColumnUnsigned($data, $expected) {
|
||||
$restore = $this->Dbo->columns;
|
||||
$this->Dbo->columns = array('string' => 1, 'integer' => 1, 'float' => 1, 'biginteger' => 1, 'any' => 1);
|
||||
|
||||
public function testBuildColumnUnsigned($data, $expected) {//debug($this->Dbo->columns);
|
||||
$result = $this->Dbo->buildColumn($data);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$this->Dbo->columns = $restore;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3188,18 +3183,20 @@ class MysqlTest extends CakeTestCase {
|
|||
array(
|
||||
'name' => 'testName',
|
||||
'type' => 'integer',
|
||||
'length' => 11,
|
||||
'unsigned' => true
|
||||
),
|
||||
'`testName` UNSIGNED'
|
||||
'`testName` int(11) UNSIGNED'
|
||||
),
|
||||
//set #1
|
||||
array(
|
||||
array(
|
||||
'name' => 'testName',
|
||||
'type' => 'biginteger',
|
||||
'length' => 20,
|
||||
'unsigned' => true
|
||||
),
|
||||
'`testName` UNSIGNED'
|
||||
'`testName` bigint(20) UNSIGNED'
|
||||
),
|
||||
//set #2
|
||||
array(
|
||||
|
@ -3208,43 +3205,54 @@ class MysqlTest extends CakeTestCase {
|
|||
'type' => 'float',
|
||||
'unsigned' => true
|
||||
),
|
||||
'`testName` UNSIGNED'
|
||||
'`testName` float UNSIGNED'
|
||||
),
|
||||
//set #3
|
||||
array(
|
||||
array(
|
||||
'name' => 'testName',
|
||||
'type' => 'string',
|
||||
'length' => 255,
|
||||
'unsigned' => true
|
||||
),
|
||||
'`testName` '
|
||||
'`testName` varchar(255)'
|
||||
),
|
||||
//set #4
|
||||
array(
|
||||
array(
|
||||
'name' => 'testName',
|
||||
'type' => 'any',
|
||||
'type' => 'date',
|
||||
'unsigned' => true
|
||||
),
|
||||
'`testName` '
|
||||
'`testName` date'
|
||||
),
|
||||
//set #5
|
||||
array(
|
||||
array(
|
||||
'name' => 'testName',
|
||||
'type' => 'any',
|
||||
'type' => 'date',
|
||||
'unsigned' => false
|
||||
),
|
||||
'`testName` '
|
||||
'`testName` date'
|
||||
),
|
||||
//set #6
|
||||
array(
|
||||
array(
|
||||
'name' => 'testName',
|
||||
'type' => 'integer',
|
||||
'length' => 11,
|
||||
'unsigned' => false
|
||||
),
|
||||
'`testName` '
|
||||
'`testName` int(11)'
|
||||
),
|
||||
//set #7
|
||||
array(
|
||||
array(
|
||||
'name' => 'testName',
|
||||
'type' => 'numeric',
|
||||
'unsigned' => true
|
||||
),
|
||||
'`testName` decimal UNSIGNED'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue