Skip to content
Permalink
Browse files

Tidy up test cases.

  • Loading branch information...
markstory committed Feb 13, 2017
1 parent b138621 commit dbca5e21e94ba7a515ed9e825844db9e9fdfb976
Showing with 23 additions and 1 deletion.
  1. +5 −0 tests/TestCase/View/Helper/FormHelperTest.php
  2. +18 −1 tests/TestCase/View/StringTemplateTest.php
@@ -8502,6 +8502,7 @@ public function testNestedLabelInput()
*
* This test makes sure `false` excludes the label from the render
*
* @return void
*/
public function testInputLabelManipulationDisableLabels()
{
@@ -8556,6 +8557,8 @@ public function testInputLabelManipulationDisableLabels()
* added to the class if checked.
*
* Also checks to make sure any custom attributes are rendered correctly
*
* @return void
*/
public function testInputLabelManipulationRadios()
{
@@ -8664,6 +8667,8 @@ public function testInputLabelManipulationRadios()
* added to the class if checked.
*
* Also checks to make sure any custom attributes are rendered correctly
*
* @return void
*/
public function testInputLabelManipulationCheckboxes()
{
@@ -305,18 +305,23 @@ public function testPushPopTemplates()
* Test addClass method newClass parameter
*
* Tests null, string, array and false for `input`
*
* @return void
*/
public function testAddClassMethodNewClass()
{
// Test new class as null, string, array, false etc
$result = $this->template->addClass([], 'new_class');
$this->assertEquals($result, ['class' => ['new_class']]);
$result = $this->template->addClass([], ['new_class']);
$this->assertEquals($result, ['class' => ['new_class']]);
$result = $this->template->addClass([], false);
$this->assertEquals($result, []);
$result = $this->template->addClass([], null);
$this->assertEquals($result, []);
$result = $this->template->addClass(null, null);
$this->assertNull($result);
}
@@ -325,23 +330,31 @@ public function testAddClassMethodNewClass()
* Test addClass method input (currentClass) parameter
*
* Tests null, string, array, false and object
*
* @return void
*/
public function testAddClassMethodCurrentClass()
{
$result = $this->template->addClass(['class' => ['current']], 'new_class');
$this->assertEquals($result, ['class' => ['current', 'new_class']]);
$result = $this->template->addClass('', 'new_class');
$this->assertEquals($result, ['class' => ['new_class']]);
$result = $this->template->addClass(null, 'new_class');
$this->assertEquals($result, ['class' => ['new_class']]);
$result = $this->template->addClass(false, 'new_class');
$this->assertEquals($result, ['class' => ['new_class']]);
$result = $this->template->addClass(new \StdClass(), 'new_class');
$this->assertEquals($result, ['class' => ['new_class']]);
}
/**
* Test addClass method string parameter, it should fallback to string
*
* @return void
*/
public function testAddClassMethodFallbackToString()
{
@@ -351,6 +364,8 @@ public function testAddClassMethodFallbackToString()
/**
* Test addClass method to make sure the returned array is unique
*
* @return void
*/
public function testAddClassMethodUnique()
{
@@ -362,6 +377,8 @@ public function testAddClassMethodUnique()
* Test addClass method useIndex param
*
* Tests for useIndex being the default, 'my_class' and false
*
* @return void
*/
public function testAddClassMethodUseIndex()
{

0 comments on commit dbca5e2

Please sign in to comment.
You can’t perform that action at this time.