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
e9c08c67
Commit
e9c08c67
authored
Jan 30, 2015
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7081 from pana1990/add-test-collapse
Added to test for Collapse class
parents
c997e0d0
bf4a35a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
CollapseTest.php
tests/unit/extensions/bootstrap/CollapseTest.php
+71
-0
No files found.
tests/unit/extensions/bootstrap/CollapseTest.php
0 → 100644
View file @
e9c08c67
<?php
namespace
yiiunit\extensions\bootstrap
;
use
yii\bootstrap\Collapse
;
class
CollapseTest
extends
BootstrapTestCase
{
public
function
testRender
()
{
Collapse
::
$counter
=
0
;
$output
=
Collapse
::
widget
([
'items'
=>
[
[
'label'
=>
'Collapsible Group Item #1'
,
'content'
=>
'test content1'
,
],
[
'label'
=>
'<h1>Collapsible Group Item #2</h1>'
,
'content'
=>
'<h2>test content2</h2>'
,
'contentOptions'
=>
[
'class'
=>
'testContentOptions2'
],
'options'
=>
[
'class'
=>
'testClass2'
,
'id'
=>
'testId2'
],
'encode'
=>
true
],
[
'label'
=>
'<h1>Collapsible Group Item #3</h1>'
,
'content'
=>
'<h2>test content3</h2>'
,
'contentOptions'
=>
[
'class'
=>
'testContentOptions3'
],
'options'
=>
[
'class'
=>
'testClass3'
,
'id'
=>
'testId3'
],
'encode'
=>
false
],
[
'label'
=>
'<h1>Collapsible Group Item #4</h1>'
,
'content'
=>
'<h1>test content4</h1>'
,
],
]
]);
$this
->
assertEquals
(
<<<HTML
<div id="w0" class="panel-group">
<div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title"><a class="collapse-toggle" href="#w0-collapse1" data-toggle="collapse" data-parent="#w0">Collapsible Group Item #1</a>
</h4></div>
<div id="w0-collapse1" class="panel-collapse collapse"><div class="panel-body">test content1</div>
</div></div>
<div id="testId2" class="testClass2 panel panel-default"><div class="panel-heading"><h4 class="panel-title"><a class="collapse-toggle" href="#w0-collapse2" data-toggle="collapse" data-parent="#w0"><h1>Collapsible Group Item #2</h1></a>
</h4></div>
<div id="w0-collapse2" class="testContentOptions2 panel-collapse collapse"><div class="panel-body"><h2>test content2</h2></div>
</div></div>
<div id="testId3" class="testClass3 panel panel-default"><div class="panel-heading"><h4 class="panel-title"><a class="collapse-toggle" href="#w0-collapse3" data-toggle="collapse" data-parent="#w0"><h1>Collapsible Group Item #3</h1></a>
</h4></div>
<div id="w0-collapse3" class="testContentOptions3 panel-collapse collapse"><div class="panel-body"><h2>test content3</h2></div>
</div></div>
<div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title"><a class="collapse-toggle" href="#w0-collapse4" data-toggle="collapse" data-parent="#w0"><h1>Collapsible Group Item #4</h1></a>
</h4></div>
<div id="w0-collapse4" class="panel-collapse collapse"><div class="panel-body"><h1>test content4</h1></div>
</div></div>
</div>
HTML
,
$output
);
}
}
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