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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
5227d2db
Commit
5227d2db
authored
Mar 13, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring.
parent
2422a134
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
Html.php
framework/util/Html.php
+0
-0
HtmlTest.php
tests/unit/framework/util/HtmlTest.php
+20
-3
No files found.
framework/util/Html.php
View file @
5227d2db
This diff is collapsed.
Click to expand it.
tests/unit/framework/util/HtmlTest.php
View file @
5227d2db
...
...
@@ -233,9 +233,26 @@ class HtmlTest extends \yii\test\TestCase
public
function
testDropDownList
()
{
$this
->
assertEquals
(
"<select name=
\"
test
\"
>
\n\n
</select>"
,
Html
::
dropDownList
(
'test'
));
$this
->
assertEquals
(
"<select name=
\"
test
\"
>
\n
<option value=
\"
value1
\"
>text1</option>
\n
<option value=
\"
value2
\"
>text2</option>
\n
</select>"
,
Html
::
dropDownList
(
'test'
,
null
,
$this
->
getDataItems
()));
$this
->
assertEquals
(
"<select name=
\"
test
\"
>
\n
<option value=
\"
value1
\"
>text1</option>
\n
<option value=
\"
value2
\"
selected=
\"
selected
\"
>text2</option>
\n
</select>"
,
Html
::
dropDownList
(
'test'
,
'value2'
,
$this
->
getDataItems
()));
$expected
=
<<<EOD
<select name="test">
</select>
EOD;
$this
->
assertEquals
(
$expected
,
Html
::
dropDownList
(
'test'
));
$expected
=
<<<EOD
<select name="test">
<option value="value1">text1</option>
<option value="value2">text2</option>
</select>
EOD;
$this
->
assertEquals
(
$expected
,
Html
::
dropDownList
(
'test'
,
null
,
$this
->
getDataItems
()));
$expected
=
<<<EOD
<select name="test">
<option value="value1">text1</option>
<option value="value2" selected="selected">text2</option>
</select>
EOD;
$this
->
assertEquals
(
$expected
,
Html
::
dropDownList
(
'test'
,
'value2'
,
$this
->
getDataItems
()));
}
public
function
testListBox
()
...
...
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