Skip to content

Commit

Permalink
inputDefaults is gone now
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 24, 2014
1 parent f435997 commit faf710f
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -881,59 +881,6 @@ public function testCreateCustomRoute() {
$this->assertTags($result, $expected);
}

/**
* test that inputDefaults are stored and used.
*
* @return void
*/
public function testCreateWithInputDefaults() {
$this->markTestIncomplete('Need to revisit once models work again.');
$this->Form->create('User', array(
'inputDefaults' => array(
'div' => false,
'label' => false,
'error' => array('attributes' => array('wrap' => 'small', 'class' => 'error')),
'format' => array('before', 'label', 'between', 'input', 'after', 'error')
)
));
$result = $this->Form->input('username');
$expected = array(
'input' => array('type' => 'text', 'name' => 'User[username]', 'id' => 'UserUsername')
);
$this->assertTags($result, $expected);

$result = $this->Form->input('username', array('div' => true, 'label' => 'username'));
$expected = array(
'div' => array('class' => 'input text'),
'label' => array('for' => 'UserUsername'), 'username', '/label',
'input' => array('type' => 'text', 'name' => 'User[username]', 'id' => 'UserUsername'),
'/div'
);
$this->assertTags($result, $expected);

$result = $this->Form->input('username', array('label' => 'Username', 'format' => array('input', 'label')));
$expected = array(
'input' => array('type' => 'text', 'name' => 'User[username]', 'id' => 'UserUsername'),
'label' => array('for' => 'UserUsername'), 'Username', '/label',
);
$this->assertTags($result, $expected);

$this->Form->create('User', array(
'inputDefaults' => array(
'div' => false,
'label' => array('class' => 'nice', 'for' => 'changed'),
)
));
$result = $this->Form->input('username', array('div' => true));
$expected = array(
'div' => array('class' => 'input text'),
'label' => array('for' => 'changed', 'class' => 'nice'), 'Username', '/label',
'input' => array('type' => 'text', 'name' => 'User[username]', 'id' => 'UserUsername'),
'/div'
);
$this->assertTags($result, $expected);
}

/**
* test automatic accept-charset overriding
*
Expand Down

0 comments on commit faf710f

Please sign in to comment.