Commit 536113e4 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Feature: FE['parameter'] and F['parameter'] will be set to '' after explosion.

parent 4cd5b21d
......@@ -77,6 +77,7 @@ class HelperFormElement {
}
}
$element = array_merge($element, $arr);
$element[$keyName]=''; // to not expand it a second time
}
}
......
......@@ -21,7 +21,8 @@ class HelperFormElementTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(), $a, "Both arrays should be equal and empty");
$a = ['id' => 100, 'parameter' => "work=12\nlist=1:new,2:edit,3:delete"];
$b = ['id' => 100, 'parameter' => "work=12\nlist=1:new,2:edit,3:delete", 'work' => 12, 'list' => '1:new,2:edit,3:delete'];
// $b = ['id' => 100, 'parameter' => "work=12\nlist=1:new,2:edit,3:delete", 'work' => 12, 'list' => '1:new,2:edit,3:delete'];
$b = ['id' => 100, 'parameter' => "", 'work' => 12, 'list' => '1:new,2:edit,3:delete'];
HelperFormElement::explodeParameter($a, FE_PARAMETER);
$this->assertEquals($b, $a, "Both arrays should be equal");
......@@ -33,7 +34,8 @@ class HelperFormElementTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(), $a, "Both arrays should be equal and empty");
$a = [0 => ['id' => 100, 'parameter' => "work=12\nlist=1:new,2:edit,3:delete"]];
$b = [0 => ['id' => 100, 'parameter' => "work=12\nlist=1:new,2:edit,3:delete", 'work' => 12, 'list' => '1:new,2:edit,3:delete']];
// $b = [0 => ['id' => 100, 'parameter' => "work=12\nlist=1:new,2:edit,3:delete", 'work' => 12, 'list' => '1:new,2:edit,3:delete']];
$b = [0 => ['id' => 100, 'parameter' => "", 'work' => 12, 'list' => '1:new,2:edit,3:delete']];
HelperFormElement::explodeParameterInArrayElements($a, FE_PARAMETER);
$this->assertEquals($b, $a, "Both arrays should be equal");
......
Supports Markdown
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