Commit 06b27ab4 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#4299 / HTML Element 'Select': Placeholder

AbstractBuildForm.php: placeholder
parent 0e67cd5e
This diff is collapsed.
...@@ -897,6 +897,8 @@ const FE_RECORD_DESTINATION_TABLE = 'recordDestinationTable'; ...@@ -897,6 +897,8 @@ const FE_RECORD_DESTINATION_TABLE = 'recordDestinationTable';
const FE_RECORD_SOURCE_TABLE = 'recordSourceTable'; const FE_RECORD_SOURCE_TABLE = 'recordSourceTable';
const FE_TRANSLATE_ID_COLUMN = 'translateIdColumn'; const FE_TRANSLATE_ID_COLUMN = 'translateIdColumn';
const FE_EMPTY_MEANS_NULL = 'emptyMeansNull'; const FE_EMPTY_MEANS_NULL = 'emptyMeansNull';
const FE_EMPTY_ITEM_AT_START = 'emptyItemAtStart';
const FE_EMPTY_ITEM_AT_END = 'emptyItemAtEnd';
const FE_FLAG_ROW_OPEN_TAG = '_flagRowOpenTag'; // will be automatically computed during Formload: true | false const FE_FLAG_ROW_OPEN_TAG = '_flagRowOpenTag'; // will be automatically computed during Formload: true | false
const FE_FLAG_ROW_CLOSE_TAG = '_flagRowCloseTag'; // will be automatically computed during Formload: true | false const FE_FLAG_ROW_CLOSE_TAG = '_flagRowCloseTag'; // will be automatically computed during Formload: true | false
......
...@@ -211,21 +211,21 @@ class BuildFormPlainTest extends AbstractDatabaseTest { ...@@ -211,21 +211,21 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
// Spec Enum + emptyItemAtStart // Spec Enum + emptyItemAtStart
$expect = ['', 'yes', 'no']; $expect = ['', 'yes', 'no'];
$formElement['emptyItemAtStart'] = ''; $formElement[FE_EMPTY_ITEM_AT_START] = '';
$build->getKeyValueListFromSqlEnumSpec($formElement, $keys, $values); $build->getKeyValueListFromSqlEnumSpec($formElement, $keys, $values);
$this->assertEquals($expect, $keys); $this->assertEquals($expect, $keys);
$this->assertEquals($expect, $values); $this->assertEquals($expect, $values);
// Spec Enum + emptyItemAtEnd // Spec Enum + emptyItemAtEnd
$expect = ['', 'yes', 'no', '']; $expect = ['', 'yes', 'no', ''];
$formElement['emptyItemAtEnd'] = ''; $formElement[FE_EMPTY_ITEM_AT_END] = '';
$build->getKeyValueListFromSqlEnumSpec($formElement, $keys, $values); $build->getKeyValueListFromSqlEnumSpec($formElement, $keys, $values);
$this->assertEquals($expect, $keys); $this->assertEquals($expect, $keys);
$this->assertEquals($expect, $values); $this->assertEquals($expect, $values);
// clean // clean
unset($formElement['emptyItemAtStart']); unset($formElement[FE_EMPTY_ITEM_AT_START]);
unset($formElement['emptyItemAtEnd']); unset($formElement[FE_EMPTY_ITEM_AT_END]);
// listItem: only value // listItem: only value
$expect = ['a', 'b', 'c']; $expect = ['a', 'b', 'c'];
...@@ -260,14 +260,14 @@ class BuildFormPlainTest extends AbstractDatabaseTest { ...@@ -260,14 +260,14 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
$this->assertEquals($expect, $values); $this->assertEquals($expect, $values);
// SQL (one column, no keyword) + emptyItemAtStart // SQL (one column, no keyword) + emptyItemAtStart
$formElement['emptyItemAtStart'] = ''; $formElement[FE_EMPTY_ITEM_AT_START] = '';
$formElement['sql1'] = $this->db->sql('SELECT name FROM Form AS f ORDER BY f.id LIMIT 3'); $formElement['sql1'] = $this->db->sql('SELECT name FROM Form AS f ORDER BY f.id LIMIT 3');
// $expect = ['', 'form', 'formElement', 'phpunit_person']; // $expect = ['', 'form', 'formElement', 'phpunit_person'];
$expect = ['', 'form', 'formElement', 'copyForm']; $expect = ['', 'form', 'formElement', 'copyForm'];
$build->getKeyValueListFromSqlEnumSpec($formElement, $keys, $values); $build->getKeyValueListFromSqlEnumSpec($formElement, $keys, $values);
$this->assertEquals($expect, $keys); $this->assertEquals($expect, $keys);
$this->assertEquals($expect, $values); $this->assertEquals($expect, $values);
unset($formElement['emptyItemAtStart']); unset($formElement[FE_EMPTY_ITEM_AT_END]);
// SQL (4 columns, none 'id' nor 'label') - Take the first two columns // SQL (4 columns, none 'id' nor 'label') - Take the first two columns
$expectKeys = ['10', '20', '30']; $expectKeys = ['10', '20', '30'];
......
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