From bda90b6ad328ec32b03afe1a536c533a701dba64 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sun, 21 Jun 2015 23:18:09 +0200 Subject: [PATCH] added another test for #8848 close #8850 --- tests/framework/widgets/ActiveFieldTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/framework/widgets/ActiveFieldTest.php b/tests/framework/widgets/ActiveFieldTest.php index 789f2f1..31c332d 100644 --- a/tests/framework/widgets/ActiveFieldTest.php +++ b/tests/framework/widgets/ActiveFieldTest.php @@ -16,8 +16,17 @@ use yii\web\AssetManager; */ class ActiveFieldTest extends \yiiunit\TestCase { + /** + * @var ActiveField + */ private $activeField; + /** + * @var DynamicModel + */ private $helperModel; + /** + * @var ActiveForm + */ private $helperForm; private $attributeName = 'attributeName'; @@ -246,6 +255,19 @@ EOD; 'value2' => ['label' => 'value 2'], ]]); $this->assertEqualsWithoutLE($expectedValue, $this->activeField->parts['{input}']); + + $expectedValue = << +EOD; + $this->activeField->model->{$this->attributeName} = 'value2'; + $this->activeField->listBox(["value1" => "Item One", "value2" => "Item 2"], ['options' => [ + 'value1' => ['disabled' => true], + 'value2' => ['label' => 'value 2'], + ]]); + $this->assertEqualsWithoutLE($expectedValue, $this->activeField->parts['{input}']); } public function testGetClientOptionsReturnEmpty()