Skip to content
Permalink
Browse files

Add tests in an attempt to reproduce #10662

  • Loading branch information...
markstory committed May 18, 2017
1 parent a8c14fe commit 18f68aaa36d72dbd91a5eccad790af45dbaebfaa
Showing with 15 additions and 0 deletions.
  1. +15 −0 tests/TestCase/View/Helper/FormHelperTest.php
@@ -3249,6 +3249,21 @@ public function testControlCheckbox()
{
$articles = TableRegistry::get('Articles');
$articles->schema()->addColumn('active', ['type' => 'boolean', 'default' => null]);
$article = $articles->newEntity();
$this->Form->create($article);
$result = $this->Form->control('Articles.active');
$expected = [
'div' => ['class' => 'input checkbox'],
'input' => ['type' => 'hidden', 'name' => 'Articles[active]', 'value' => '0'],
'label' => ['for' => 'articles-active'],
['input' => ['type' => 'checkbox', 'name' => 'Articles[active]', 'value' => '1', 'id' => 'articles-active']],
'Active',
'/label',
'/div'
];
$this->assertHtml($expected, $result);
$result = $this->Form->control('Articles.active', ['label' => false, 'checked' => true]);
$expected = [

0 comments on commit 18f68aa

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