Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Commit

Permalink
Improve test to get 100% code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
neilime committed Jan 11, 2014
1 parent d081142 commit 0670655
Show file tree
Hide file tree
Showing 37 changed files with 271 additions and 281 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ public function testRenderWithShoulddWrap(){
);
}

public function testRenderInlineFieldset(){
public function testRenderInlineFieldsetWithAlreadyDefinedClass(){
$oFieldset = new \Zend\Form\Fieldset('inline-fieldset',array('twb-layout' => \TwbBundle\Form\View\Helper\TwbBundleForm::LAYOUT_INLINE));
$oFieldset->setAttribute('class', 'test-class');

$oFieldset->add(array(
'name' => 'input-one',
'attributes' => array('placeholder' => 'input-one'),
Expand Down
4 changes: 2 additions & 2 deletions tests/_files/expected-fieldsets/inline-fieldset.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<fieldset class="form-inline"><fieldset class="form-inline"><div class="form-group "><input name="input-one" placeholder="input-one" class="form-control" type="text" value=""></div>
<fieldset class="form-inline"><fieldset class="test-class form-inline"><div class="form-group "><input name="input-one" placeholder="input-one" class="form-control" type="text" value=""></div>
<div class="form-group "><input name="input-two" placeholder="input-two" class="form-control" type="text" value=""></div>
</fieldset><span data-template="&lt;fieldset&#x20;class&#x3D;&quot;form-inline&quot;&gt;&lt;div&#x20;class&#x3D;&quot;form-group&#x20;&quot;&gt;&lt;input&#x20;name&#x3D;&quot;input-one&quot;&#x20;placeholder&#x3D;&quot;input-one&quot;&#x20;class&#x3D;&quot;form-control&quot;&#x20;type&#x3D;&quot;text&quot;&#x20;value&#x3D;&quot;&quot;&gt;&lt;&#x2F;div&gt;&#x0D;&#x0A;&lt;div&#x20;class&#x3D;&quot;form-group&#x20;&quot;&gt;&lt;input&#x20;name&#x3D;&quot;input-two&quot;&#x20;placeholder&#x3D;&quot;input-two&quot;&#x20;class&#x3D;&quot;form-control&quot;&#x20;type&#x3D;&quot;text&quot;&#x20;value&#x3D;&quot;&quot;&gt;&lt;&#x2F;div&gt;&#x0D;&#x0A;&lt;&#x2F;fieldset&gt;"></span></fieldset>
</fieldset><span data-template="&lt;fieldset&#x20;class&#x3D;&quot;test-class&#x20;form-inline&quot;&gt;&lt;div&#x20;class&#x3D;&quot;form-group&#x20;&quot;&gt;&lt;input&#x20;name&#x3D;&quot;input-one&quot;&#x20;placeholder&#x3D;&quot;input-one&quot;&#x20;class&#x3D;&quot;form-control&quot;&#x20;type&#x3D;&quot;text&quot;&#x20;value&#x3D;&quot;&quot;&gt;&lt;&#x2F;div&gt;&#x0D;&#x0A;&lt;div&#x20;class&#x3D;&quot;form-group&#x20;&quot;&gt;&lt;input&#x20;name&#x3D;&quot;input-two&quot;&#x20;placeholder&#x3D;&quot;input-two&quot;&#x20;class&#x3D;&quot;form-control&quot;&#x20;type&#x3D;&quot;text&quot;&#x20;value&#x3D;&quot;&quot;&gt;&lt;&#x2F;div&gt;&#x0D;&#x0A;&lt;&#x2F;fieldset&gt;"></span></fieldset>
2 changes: 1 addition & 1 deletion tests/_report/Module.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h4>Legend</h4>
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 1.2.13</a> using <a href="http://www.php.net/" target="_top">PHP 5.5.5</a> and <a href="http://phpunit.de/">PHPUnit 3.7.28</a> at Wed Jan 8 22:18:24 CET 2014.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 1.2.13</a> using <a href="http://www.php.net/" target="_top">PHP 5.5.5</a> and <a href="http://phpunit.de/">PHPUnit 3.7.28</a> at Sat Jan 11 10:29:56 CET 2014.</small>
</p>
</footer>
</div>
Expand Down
8 changes: 3 additions & 5 deletions tests/_report/index.dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,19 @@ <h2>Class Complexity</h2>
<div class="span6">
<h2>Top Project Risks</h2>
<ul>
<li><a href="src_TwbBundle_Form_View_Helper_TwbBundleFormCollection.php.html#3">TwbBundleFormCollection</a> (17)</li>

</ul>
</div>
<div class="span6">
<h2>Least Tested Methods</h2>
<ul>
<li><a href="src_TwbBundle_Form_View_Helper_TwbBundleFormCollection.php.html#28">TwbBundleFormCollection::render</a> (89%)</li>

</ul>
</div>
</div>
<footer>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 1.2.13</a> using <a href="http://www.php.net/" target="_top">PHP 5.5.5</a> and <a href="http://phpunit.de/">PHPUnit 3.7.28</a> at Wed Jan 8 22:18:24 CET 2014.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 1.2.13</a> using <a href="http://www.php.net/" target="_top">PHP 5.5.5</a> and <a href="http://phpunit.de/">PHPUnit 3.7.28</a> at Sat Jan 11 10:29:56 CET 2014.</small>
</p>
</footer>
</div>
Expand Down Expand Up @@ -85,7 +83,7 @@ <h2>Least Tested Methods</h2>
min: 0
},
series: [{
data: [0,0,0,0,0,0,0,0,0,1,0,16]
data: [0,0,0,0,0,0,0,0,0,0,0,17]
}],
});

Expand Down Expand Up @@ -113,7 +111,7 @@ <h2>Least Tested Methods</h2>
}
},
series: [{
data: [[100,2,"<a href=\"Module.php.html#3\">Module<\/a>"],[100,0,"<a href=\"src_TwbBundle_Form_Element_StaticElement.php.html#3\">StaticElement<\/a>"],[100,16,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleForm.php.html#3\">TwbBundleForm<\/a>"],[100,30,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormButton.php.html#3\">TwbBundleFormButton<\/a>"],[100,17,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormCheckbox.php.html#3\">TwbBundleFormCheckbox<\/a>"],[89.74358974359,17,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormCollection.php.html#3\">TwbBundleFormCollection<\/a>"],[100,37,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormElement.php.html#3\">TwbBundleFormElement<\/a>"],[100,0,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormElementErrors.php.html#3\">TwbBundleFormElementErrors<\/a>"],[100,5,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormMultiCheckbox.php.html#3\">TwbBundleFormMultiCheckbox<\/a>"],[100,24,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormRadio.php.html#3\">TwbBundleFormRadio<\/a>"],[100,47,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormRow.php.html#3\">TwbBundleFormRow<\/a>"],[100,1,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormStatic.php.html#3\">TwbBundleFormStatic<\/a>"],[100,13,"<a href=\"src_TwbBundle_View_Helper_TwbBundleAlert.php.html#3\">TwbBundleAlert<\/a>"],[100,8,"<a href=\"src_TwbBundle_View_Helper_TwbBundleBadge.php.html#3\">TwbBundleBadge<\/a>"],[100,58,"<a href=\"src_TwbBundle_View_Helper_TwbBundleDropdown.php.html#3\">TwbBundleDropDown<\/a>"],[100,9,"<a href=\"src_TwbBundle_View_Helper_TwbBundleGlyphicon.php.html#3\">TwbBundleGlyphicon<\/a>"],[100,12,"<a href=\"src_TwbBundle_View_Helper_TwbBundleLabel.php.html#3\">TwbBundleLabel<\/a>"]],
data: [[100,2,"<a href=\"Module.php.html#3\">Module<\/a>"],[100,0,"<a href=\"src_TwbBundle_Form_Element_StaticElement.php.html#3\">StaticElement<\/a>"],[100,16,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleForm.php.html#3\">TwbBundleForm<\/a>"],[100,30,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormButton.php.html#3\">TwbBundleFormButton<\/a>"],[100,17,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormCheckbox.php.html#3\">TwbBundleFormCheckbox<\/a>"],[100,17,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormCollection.php.html#3\">TwbBundleFormCollection<\/a>"],[100,37,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormElement.php.html#3\">TwbBundleFormElement<\/a>"],[100,0,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormElementErrors.php.html#3\">TwbBundleFormElementErrors<\/a>"],[100,5,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormMultiCheckbox.php.html#3\">TwbBundleFormMultiCheckbox<\/a>"],[100,24,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormRadio.php.html#3\">TwbBundleFormRadio<\/a>"],[100,47,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormRow.php.html#3\">TwbBundleFormRow<\/a>"],[100,1,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormStatic.php.html#3\">TwbBundleFormStatic<\/a>"],[100,13,"<a href=\"src_TwbBundle_View_Helper_TwbBundleAlert.php.html#3\">TwbBundleAlert<\/a>"],[100,8,"<a href=\"src_TwbBundle_View_Helper_TwbBundleBadge.php.html#3\">TwbBundleBadge<\/a>"],[100,58,"<a href=\"src_TwbBundle_View_Helper_TwbBundleDropdown.php.html#3\">TwbBundleDropDown<\/a>"],[100,9,"<a href=\"src_TwbBundle_View_Helper_TwbBundleGlyphicon.php.html#3\">TwbBundleGlyphicon<\/a>"],[100,12,"<a href=\"src_TwbBundle_View_Helper_TwbBundleLabel.php.html#3\">TwbBundleLabel<\/a>"]],
marker: {
symbol: 'diamond'
}
Expand Down
38 changes: 19 additions & 19 deletions tests/_report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,45 @@
<tr>
<td class="success">Total</td>
<td class="success big"> <div class="progress progress-success" style="width: 100px;">
<div class="bar" style="width: 99.32%;"></div>
<div class="bar" style="width: 100.00%;"></div>
</div>
</td>
<td class="success small"><div align="right">99.32%</div></td>
<td class="success small"><div align="right">581&nbsp;/&nbsp;585</div></td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">585&nbsp;/&nbsp;585</div></td>
<td class="success big"> <div class="progress progress-success" style="width: 100px;">
<div class="bar" style="width: 97.37%;"></div>
<div class="bar" style="width: 100.00%;"></div>
</div>
</td>
<td class="success small"><div align="right">97.37%</div></td>
<td class="success small"><div align="right">37&nbsp;/&nbsp;38</div></td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">38&nbsp;/&nbsp;38</div></td>
<td class="success big"> <div class="progress progress-success" style="width: 100px;">
<div class="bar" style="width: 94.12%;"></div>
<div class="bar" style="width: 100.00%;"></div>
</div>
</td>
<td class="success small"><div align="right">94.12%</div></td>
<td class="success small"><div align="right">16&nbsp;/&nbsp;17</div></td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">17&nbsp;/&nbsp;17</div></td>
</tr>

<tr>
<td class="success"><i class="icon-folder-open"></i> <a href="src.html">src</a></td>
<td class="success big"> <div class="progress progress-success" style="width: 100px;">
<div class="bar" style="width: 99.31%;"></div>
<div class="bar" style="width: 100.00%;"></div>
</div>
</td>
<td class="success small"><div align="right">99.31%</div></td>
<td class="success small"><div align="right">577&nbsp;/&nbsp;581</div></td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">581&nbsp;/&nbsp;581</div></td>
<td class="success big"> <div class="progress progress-success" style="width: 100px;">
<div class="bar" style="width: 97.22%;"></div>
<div class="bar" style="width: 100.00%;"></div>
</div>
</td>
<td class="success small"><div align="right">97.22%</div></td>
<td class="success small"><div align="right">35&nbsp;/&nbsp;36</div></td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">36&nbsp;/&nbsp;36</div></td>
<td class="success big"> <div class="progress progress-success" style="width: 100px;">
<div class="bar" style="width: 93.75%;"></div>
<div class="bar" style="width: 100.00%;"></div>
</div>
</td>
<td class="success small"><div align="right">93.75%</div></td>
<td class="success small"><div align="right">15&nbsp;/&nbsp;16</div></td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">16&nbsp;/&nbsp;16</div></td>
</tr>

<tr>
Expand Down Expand Up @@ -117,7 +117,7 @@ <h4>Legend</h4>
<span class="success"><strong>High</strong>: 70% to 100%</span>
</p>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 1.2.13</a> using <a href="http://www.php.net/" target="_top">PHP 5.5.5</a> and <a href="http://phpunit.de/">PHPUnit 3.7.28</a> at Wed Jan 8 22:18:24 CET 2014.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 1.2.13</a> using <a href="http://www.php.net/" target="_top">PHP 5.5.5</a> and <a href="http://phpunit.de/">PHPUnit 3.7.28</a> at Sat Jan 11 10:29:56 CET 2014.</small>
</p>
</footer>
</div>
Expand Down
8 changes: 3 additions & 5 deletions tests/_report/src.dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,19 @@ <h2>Class Complexity</h2>
<div class="span6">
<h2>Top Project Risks</h2>
<ul>
<li><a href="src_TwbBundle_Form_View_Helper_TwbBundleFormCollection.php.html#3">TwbBundleFormCollection</a> (17)</li>

</ul>
</div>
<div class="span6">
<h2>Least Tested Methods</h2>
<ul>
<li><a href="src_TwbBundle_Form_View_Helper_TwbBundleFormCollection.php.html#28">TwbBundleFormCollection::render</a> (89%)</li>

</ul>
</div>
</div>
<footer>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 1.2.13</a> using <a href="http://www.php.net/" target="_top">PHP 5.5.5</a> and <a href="http://phpunit.de/">PHPUnit 3.7.28</a> at Wed Jan 8 22:18:24 CET 2014.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 1.2.13</a> using <a href="http://www.php.net/" target="_top">PHP 5.5.5</a> and <a href="http://phpunit.de/">PHPUnit 3.7.28</a> at Sat Jan 11 10:29:56 CET 2014.</small>
</p>
</footer>
</div>
Expand Down Expand Up @@ -86,7 +84,7 @@ <h2>Least Tested Methods</h2>
min: 0
},
series: [{
data: [0,0,0,0,0,0,0,0,0,1,0,15]
data: [0,0,0,0,0,0,0,0,0,0,0,16]
}],
});

Expand Down Expand Up @@ -114,7 +112,7 @@ <h2>Least Tested Methods</h2>
}
},
series: [{
data: [[100,0,"<a href=\"src_TwbBundle_Form_Element_StaticElement.php.html#3\">StaticElement<\/a>"],[100,16,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleForm.php.html#3\">TwbBundleForm<\/a>"],[100,30,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormButton.php.html#3\">TwbBundleFormButton<\/a>"],[100,17,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormCheckbox.php.html#3\">TwbBundleFormCheckbox<\/a>"],[89.74358974359,17,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormCollection.php.html#3\">TwbBundleFormCollection<\/a>"],[100,37,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormElement.php.html#3\">TwbBundleFormElement<\/a>"],[100,0,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormElementErrors.php.html#3\">TwbBundleFormElementErrors<\/a>"],[100,5,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormMultiCheckbox.php.html#3\">TwbBundleFormMultiCheckbox<\/a>"],[100,24,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormRadio.php.html#3\">TwbBundleFormRadio<\/a>"],[100,47,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormRow.php.html#3\">TwbBundleFormRow<\/a>"],[100,1,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormStatic.php.html#3\">TwbBundleFormStatic<\/a>"],[100,13,"<a href=\"src_TwbBundle_View_Helper_TwbBundleAlert.php.html#3\">TwbBundleAlert<\/a>"],[100,8,"<a href=\"src_TwbBundle_View_Helper_TwbBundleBadge.php.html#3\">TwbBundleBadge<\/a>"],[100,58,"<a href=\"src_TwbBundle_View_Helper_TwbBundleDropdown.php.html#3\">TwbBundleDropDown<\/a>"],[100,9,"<a href=\"src_TwbBundle_View_Helper_TwbBundleGlyphicon.php.html#3\">TwbBundleGlyphicon<\/a>"],[100,12,"<a href=\"src_TwbBundle_View_Helper_TwbBundleLabel.php.html#3\">TwbBundleLabel<\/a>"]],
data: [[100,0,"<a href=\"src_TwbBundle_Form_Element_StaticElement.php.html#3\">StaticElement<\/a>"],[100,16,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleForm.php.html#3\">TwbBundleForm<\/a>"],[100,30,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormButton.php.html#3\">TwbBundleFormButton<\/a>"],[100,17,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormCheckbox.php.html#3\">TwbBundleFormCheckbox<\/a>"],[100,17,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormCollection.php.html#3\">TwbBundleFormCollection<\/a>"],[100,37,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormElement.php.html#3\">TwbBundleFormElement<\/a>"],[100,0,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormElementErrors.php.html#3\">TwbBundleFormElementErrors<\/a>"],[100,5,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormMultiCheckbox.php.html#3\">TwbBundleFormMultiCheckbox<\/a>"],[100,24,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormRadio.php.html#3\">TwbBundleFormRadio<\/a>"],[100,47,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormRow.php.html#3\">TwbBundleFormRow<\/a>"],[100,1,"<a href=\"src_TwbBundle_Form_View_Helper_TwbBundleFormStatic.php.html#3\">TwbBundleFormStatic<\/a>"],[100,13,"<a href=\"src_TwbBundle_View_Helper_TwbBundleAlert.php.html#3\">TwbBundleAlert<\/a>"],[100,8,"<a href=\"src_TwbBundle_View_Helper_TwbBundleBadge.php.html#3\">TwbBundleBadge<\/a>"],[100,58,"<a href=\"src_TwbBundle_View_Helper_TwbBundleDropdown.php.html#3\">TwbBundleDropDown<\/a>"],[100,9,"<a href=\"src_TwbBundle_View_Helper_TwbBundleGlyphicon.php.html#3\">TwbBundleGlyphicon<\/a>"],[100,12,"<a href=\"src_TwbBundle_View_Helper_TwbBundleLabel.php.html#3\">TwbBundleLabel<\/a>"]],
marker: {
symbol: 'diamond'
}
Expand Down
Loading

0 comments on commit 0670655

Please sign in to comment.