"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/framework/helpers/HtmlTest.php" between
yii2-2.0.36.tar.gz and yii2-2.0.37.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

HtmlTest.php  (yii2-2.0.36):HtmlTest.php  (yii2-2.0.37)
skipping to change at line 770 skipping to change at line 770
$expected = <<<'EOD' $expected = <<<'EOD'
<div><label><input type="checkbox" name="test[]" value="0"> Test Label</label> <div><label><input type="checkbox" name="test[]" value="0"> Test Label</label>
<label><input type="checkbox" name="test[]" value="0"> Test Label</label></div> <label><input type="checkbox" name="test[]" value="0"> Test Label</label></div>
EOD; EOD;
$this->assertEqualsWithoutLE($expected, Html::checkboxList('test', null, $this->getDataItems(), [ $this->assertEqualsWithoutLE($expected, Html::checkboxList('test', null, $this->getDataItems(), [
'itemOptions' => [ 'itemOptions' => [
'value' => 0, 'value' => 0,
'label' => 'Test Label' 'label' => 'Test Label'
] ]
])); ]));
$expected = <<<'EOD'
<div><label><input type="checkbox" name="test[]" value="1"> 1</label>
<label><input type="checkbox" name="test[]" value="1.1" checked> 1.1</label>
<label><input type="checkbox" name="test[]" value="1.10"> 1.10</label></div>
EOD;
$this->assertEqualsWithoutLE($expected, Html::checkboxList('test', ['1.1
'], ['1' => '1', '1.1' => '1.1', '1.10' => '1.10'], ['strict' => true]));
} }
public function testRadioListWithArrayExpression() public function testRadioListWithArrayExpression()
{ {
$selection = new ArrayExpression(['first']); $selection = new ArrayExpression(['first']);
$output = Html::radioList( $output = Html::radioList(
'test', 'test',
$selection, $selection,
[ [
skipping to change at line 911 skipping to change at line 918
$expected = <<<'EOD' $expected = <<<'EOD'
<div><label><input type="radio" name="test" value="0"> Test Label</label> <div><label><input type="radio" name="test" value="0"> Test Label</label>
<label><input type="radio" name="test" value="0"> Test Label</label></div> <label><input type="radio" name="test" value="0"> Test Label</label></div>
EOD; EOD;
$this->assertEqualsWithoutLE($expected, Html::radioList('test', null, $t his->getDataItems(), [ $this->assertEqualsWithoutLE($expected, Html::radioList('test', null, $t his->getDataItems(), [
'itemOptions' => [ 'itemOptions' => [
'value' => 0, 'value' => 0,
'label' => 'Test Label' 'label' => 'Test Label'
] ]
])); ]));
$expected = <<<'EOD'
<div><label><input type="radio" name="test" value="1"> 1</label>
<label><input type="radio" name="test" value="1.1" checked> 1.1</label>
<label><input type="radio" name="test" value="1.10"> 1.10</label></div>
EOD;
$this->assertEqualsWithoutLE($expected, Html::radioList('test', ['1.1'],
['1' => '1', '1.1' => '1.1', '1.10' => '1.10'], ['strict' => true]));
} }
public function testUl() public function testUl()
{ {
$data = [ $data = [
1, 'abc', '<>', 1, 'abc', '<>',
]; ];
$expected = <<<'EOD' $expected = <<<'EOD'
<ul> <ul>
<li>1</li> <li>1</li>
skipping to change at line 1048 skipping to change at line 1062
<option class="prompt" value="-1" label="None">Please select</option> <option class="prompt" value="-1" label="None">Please select</option>
<option value="value1" selected>label1</option> <option value="value1" selected>label1</option>
<option value="value2">label2</option> <option value="value2">label2</option>
EOD; EOD;
$attributes = [ $attributes = [
'prompt' => [ 'prompt' => [
'text' => 'Please select', 'options' => ['class' => 'prompt', 'v alue' => '-1', 'label' => 'None'], 'text' => 'Please select', 'options' => ['class' => 'prompt', 'v alue' => '-1', 'label' => 'None'],
], ],
]; ];
$this->assertEqualsWithoutLE($expected, Html::renderSelectOptions(['valu e1'], $data, $attributes)); $this->assertEqualsWithoutLE($expected, Html::renderSelectOptions(['valu e1'], $data, $attributes));
$expected = <<<'EOD'
<option value="1">1</option>
<option value="1.1" selected>1.1</option>
<option value="1.10">1.10</option>
EOD;
$data = ['1' => '1', '1.1' => '1.1', '1.10' => '1.10'];
$attributes = ['strict' => true];
$this->assertEqualsWithoutLE($expected, Html::renderSelectOptions(['1.1'
], $data, $attributes));
$expected = <<<'EOD'
<option value="1">1</option>
<option value="1.1">1.1</option>
<optgroup label="group">
<option value="1.10" selected>1.10</option>
</optgroup>
EOD;
$data = ['1' => '1', '1.1' => '1.1', 'group' => ['1.10' => '1.10']];
$attributes = ['strict' => true];
$this->assertEqualsWithoutLE($expected, Html::renderSelectOptions(['1.10
'], $data, $attributes));
} }
public function testRenderAttributes() public function testRenderAttributes()
{ {
$this->assertEquals('', Html::renderTagAttributes([])); $this->assertEquals('', Html::renderTagAttributes([]));
$this->assertEquals(' name="test" value="1&lt;&gt;"', Html::renderTagAtt ributes(['name' => 'test', 'empty' => null, 'value' => '1<>'])); $this->assertEquals(' name="test" value="1&lt;&gt;"', Html::renderTagAtt ributes(['name' => 'test', 'empty' => null, 'value' => '1<>']));
$this->assertEquals(' checked disabled', Html::renderTagAttributes(['che cked' => true, 'disabled' => true, 'hidden' => false])); $this->assertEquals(' checked disabled', Html::renderTagAttributes(['che cked' => true, 'disabled' => true, 'hidden' => false]));
$this->assertEquals(' class="first second"', Html::renderTagAttributes([ 'class' => ['first', 'second']])); $this->assertEquals(' class="first second"', Html::renderTagAttributes([ 'class' => ['first', 'second']]));
$this->assertEquals('', Html::renderTagAttributes(['class' => []])); $this->assertEquals('', Html::renderTagAttributes(['class' => []]));
$this->assertEquals(' style="width: 100px; height: 200px;"', Html::rende rTagAttributes(['style' => ['width' => '100px', 'height' => '200px']])); $this->assertEquals(' style="width: 100px; height: 200px;"', Html::rende rTagAttributes(['style' => ['width' => '100px', 'height' => '200px']]));
 End of changes. 3 change blocks. 
0 lines changed or deleted 38 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)