Commit d06f849a by Alexander Makarov

Another test attempt for #5356

parent 482e56da
......@@ -278,12 +278,6 @@ EOD;
public function testListBox()
{
$expected = <<<EOD
<select name="test[]" multiple size="4">
</select>
EOD;
$this->assertEqualsWithoutLE($expected, Html::listBox('test', null, [], ['multiple' => true]));
$expected = <<<EOD
<select name="test" size="4">
</select>
......
......@@ -50,4 +50,21 @@ EOF
, (string) $form->field($model, 'name', $o)->input('email', ['required' => 'test']));
}
public function testIssue5356()
{
$model = new DynamicModel(['categories']);
$model->categories = 1;
ob_start();
$form = new ActiveForm(['action' => '/something']);
ob_end_clean();
// https://github.com/yiisoft/yii2/issues/5356
$this->assertEquals(<<<EOF
<div class="form-group field-dynamicmodel-name">
<input type="email" id="dynamicmodel-name" class="form-control" name="DynamicModel[name]" required>
</div>
EOF
, (string) $form->field($model, 'categories')->listBox(['apple', 'banana', 'avocado'], ['multiple' => true]));
}
}
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