Skip to content

Commit

Permalink
Add simple test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jan 4, 2016
1 parent 256da43 commit 49ea700
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -581,6 +581,30 @@ public function testInputTemplateVars()
];
$this->assertHtml($expected, $result);
}

/**
* Test using template vars in submitContainer template.
*
* @return void
*/
public function testSubmitTemplateVars()
{
$this->Form->templates([
'submitContainer' => '<div class="submit">{{content}}{{forcontainer}}</div>'
]);
$result = $this->Form->submit('Submit', [
'templateVars' => [
'forcontainer' => 'in-container'
]
]);
$expected = [
'div' => ['class'],
'input' => ['type' => 'submit', 'value' => 'Submit'],
'in-container',
'/div',
];
$this->assertHtml($expected, $result);
}

/**
* test the create() method
Expand Down

0 comments on commit 49ea700

Please sign in to comment.