Commit 68e934ff authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fix remaining failed unit tests.

parent b26f335d
Pipeline #5234 failed with stages
in 2 minutes and 18 seconds
......@@ -1171,6 +1171,7 @@ class Support {
* @return int
*/
private static function maxLengthSetEnum($typeSpec) {
$isSet = substr($typeSpec, 0, 4) === 'set(';
$startPos = $isSet ? 4 : 5;
$max = 0;
......
......@@ -949,7 +949,7 @@ class SupportTest extends TestCase {
$expected[FE_MIN] = -2147483648;
$expected[FE_MAX] = 2147483647;
if (isset($formElement[FE_MAX_LENGTH_COLUMN])) {
$expected[FE_MAX_LENGTH_COLUMN] = 11;
$expected[FE_MAX_LENGTH_COLUMN] = '11';
}
$this->assertEquals($expected, $formElement, "CheckType Auto should switch to numerical for signed int");
......@@ -961,7 +961,7 @@ class SupportTest extends TestCase {
$expected[FE_MIN] = 0;
$expected[FE_MAX] = 4294967295;
if (isset($formElement[FE_MAX_LENGTH_COLUMN])) {
$expected[FE_MAX_LENGTH_COLUMN] = 11;
$expected[FE_MAX_LENGTH_COLUMN] = '11';
}
$this->assertEquals($expected, $formElement, "CheckType Auto should switch to digit for unsigned int");
......@@ -971,7 +971,7 @@ class SupportTest extends TestCase {
Support::adjustFeToColumnDefinition($formElement, 'decimal(10,2) not null');
$expected[FE_CHECK_TYPE] = SANITIZE_ALLOW_NUMERICAL;
if (isset($formElement[FE_MAX_LENGTH_COLUMN])) {
$expected[FE_MAX_LENGTH_COLUMN] = 13;
$expected[FE_MAX_LENGTH_COLUMN] = '13';
}
$this->assertEquals($expected, $formElement, "CheckType Auto should switch to numerical for decimal");
......@@ -984,10 +984,10 @@ class SupportTest extends TestCase {
$expected = $formElement;
Support::adjustFeToColumnDefinition($formElement, 'varchar(255)');
$expected[FE_CHECK_TYPE] = SANITIZE_ALLOW_ALL;
// $expected[FE_MAX_LENGTH] = 255;
$expected[FE_MAX_LENGTH] = '';
$expected[FE_MAX_LENGTH] = '255';
// $expected[FE_MAX_LENGTH] = '';
if (isset($formElement[FE_MAX_LENGTH_COLUMN])) {
$expected[FE_MAX_LENGTH_COLUMN] = 255;
$expected[FE_MAX_LENGTH_COLUMN] = '255';
}
$this->assertEquals($expected, $formElement, "Checktype Auto should switch to all for text with encode=specialchars");
......@@ -996,10 +996,10 @@ class SupportTest extends TestCase {
$expected = $formElement;
Support::adjustFeToColumnDefinition($formElement, 'varchar(64)');
$expected[FE_CHECK_TYPE] = SANITIZE_ALLOW_ALNUMX;
// $expected[FE_MAX_LENGTH] = 64;
$expected[FE_MAX_LENGTH] = '';
$expected[FE_MAX_LENGTH] = 64;
// $expected[FE_MAX_LENGTH] = '';
if (isset($formElement[FE_MAX_LENGTH_COLUMN])) {
$expected[FE_MAX_LENGTH_COLUMN] = 64;
$expected[FE_MAX_LENGTH_COLUMN] = '64';
}
$this->assertEquals($expected, $formElement, "Checktype Auto should switch to alnumx for text with encode=none");
......@@ -1011,7 +1011,7 @@ class SupportTest extends TestCase {
$expected[FE_MIN] = -2147483648;
$expected[FE_MAX] = 2147483647;
if (isset($formElement[FE_MAX_LENGTH_COLUMN])) {
$expected[FE_MAX_LENGTH_COLUMN] = 11;
$expected[FE_MAX_LENGTH_COLUMN] = '11';
}
$this->assertEquals($expected, $formElement, "Checktype Auto should switch to alnumx if typeAhead is defined");
......@@ -1019,6 +1019,7 @@ class SupportTest extends TestCase {
$formElement[FE_CHECK_TYPE] = SANITIZE_ALLOW_ALNUMX;
$expected = $formElement;
Support::adjustFeToColumnDefinition($formElement, 'datetime');
$expected[FE_MAX_LENGTH] = strlen('0000/00/00 00:00:00');
if (isset($formElement[FE_MAX_LENGTH_COLUMN])) {
$expected[FE_MAX_LENGTH_COLUMN] = strlen('0000/00/00 00:00:00');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment