Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
96feeb89
Commit
96feeb89
authored
May 22, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test break of Html.
parent
cbf27d14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
HtmlTest.php
tests/unit/framework/helpers/HtmlTest.php
+18
-3
No files found.
tests/unit/framework/helpers/HtmlTest.php
View file @
96feeb89
...
@@ -289,16 +289,23 @@ EOD;
...
@@ -289,16 +289,23 @@ EOD;
<option value="value2">text2</option>
<option value="value2">text2</option>
</select>
</select>
EOD;
EOD;
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
listBox
(
'test'
,
null
,
$this
->
getDataItems
(),
[
'size'
=>
5
,
'encodeSpaces'
=>
true
]));
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
listBox
(
'test'
,
null
,
$this
->
getDataItems
(),
[
'size'
=>
5
]));
$expected
=
<<<EOD
$expected
=
<<<EOD
<select name="test" size="4">
<select name="test" size="4">
<option value="value1<>">text1<></option>
<option value="value1<>">text1<></option>
<option value="value 2">text
2</option>
<option value="value 2">text
2</option>
</select>
</select>
EOD;
EOD;
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
listBox
(
'test'
,
null
,
$this
->
getDataItems2
()));
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
listBox
(
'test'
,
null
,
$this
->
getDataItems2
()));
$expected
=
<<<EOD
$expected
=
<<<EOD
<select name="test" size="4">
<select name="test" size="4">
<option value="value1<>">text1<></option>
<option value="value 2">text 2</option>
</select>
EOD;
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
listBox
(
'test'
,
null
,
$this
->
getDataItems2
(),
[
'encodeSpaces'
=>
true
]));
$expected
=
<<<EOD
<select name="test" size="4">
<option value="value1">text1</option>
<option value="value1">text1</option>
<option value="value2" selected>text2</option>
<option value="value2" selected>text2</option>
</select>
</select>
...
@@ -499,7 +506,15 @@ EOD;
...
@@ -499,7 +506,15 @@ EOD;
];
];
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
renderSelectOptions
([
'value111'
,
'value1'
],
$data
,
$attributes
));
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
renderSelectOptions
([
'value111'
,
'value1'
],
$data
,
$attributes
));
$attributes
[
'encodeSpaces'
]
=
false
;
$attributes
=
[
'prompt'
=>
'please select<>'
,
'options'
=>
[
'value111'
=>
[
'class'
=>
'option'
],
],
'groups'
=>
[
'group12'
=>
[
'class'
=>
'group'
],
],
];
$this
->
assertEqualsWithoutLE
(
str_replace
(
' '
,
' '
,
$expected
),
Html
::
renderSelectOptions
([
'value111'
,
'value1'
],
$data
,
$attributes
));
$this
->
assertEqualsWithoutLE
(
str_replace
(
' '
,
' '
,
$expected
),
Html
::
renderSelectOptions
([
'value111'
,
'value1'
],
$data
,
$attributes
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment