Skip to content
Permalink
Browse files

Removing code that is no longer needed

  • Loading branch information...
lorenzo committed Feb 24, 2014
1 parent 321df80 commit f4359973a319f7a6d6856319d547e9d00e153b07
Showing with 1 addition and 124 deletions.
  1. +1 −26 src/View/Helper/FormHelper.php
  2. +0 −98 tests/TestCase/View/Helper/FormHelperTest.php
@@ -99,13 +99,6 @@ class FormHelper extends Helper {
*/
public $requestType = null;
/**
* Persistent default options used by input(). Set by FormHelper::create().
*
* @var array
*/
protected $_inputDefaults = array();
/**
* An array of field names that have been excluded from
* the Token hash used by SecurityComponent's validatePost method
@@ -171,7 +164,7 @@ class FormHelper extends Helper {
];
/**
* Copies the validationErrors variable from the View object into this instance
* Construct the widgets and binds the defult context providers
*
* @param \Cake\View\View $View The View this helper is being attached to.
* @param array $settings Configuration settings for the helper.
@@ -2410,24 +2403,6 @@ protected function _secureFieldName($options) {
return $parts;
}
/**
* Set/Get inputDefaults for form elements
*
* @param array $defaults New default values
* @param boolean Merge with current defaults
* @return array inputDefaults
*/
public function inputDefaults($defaults = null, $merge = false) {
if ($defaults !== null) {
if ($merge) {
$this->_inputDefaults = array_merge($this->_inputDefaults, (array)$defaults);
} else {
$this->_inputDefaults = (array)$defaults;
}
}
return $this->_inputDefaults;
}
/**
* Add a new context type.
*
@@ -7648,42 +7648,6 @@ public function testHtml5InputException() {
$this->Form->email();
}
/**
* Tests that a model can be loaded from the model names passed in the request object
*
* @return void
*/
public function testIntrospectModelFromRequest() {
$this->markTestIncomplete('Need to revisit once models work again.');
$this->loadFixtures('Post');
App::build(array(
'Plugin' => array(CAKE . 'Test/TestApp/Plugin/')
));
Plugin::load('TestPlugin');
$this->Form->request['models'] = array(
'TestPluginPost' => array(
'plugin' => 'TestPlugin',
'className' => 'TestPluginPost'
)
);
$this->Form->create('TestPluginPost');
Plugin::unload();
}
/**
* Tests that it is possible to set the validation errors directly in the helper for a field
*
* @return void
*/
public function testCustomValidationErrors() {
$this->markTestIncomplete('Need to revisit once models work again.');
$this->Form->validationErrors['Thing']['field'] = 'Badness!';
$result = $this->Form->error('Thing.field', null, array('wrap' => false));
$this->assertEquals('Badness!', $result);
}
/**
* Tests that the 'on' key validates as expected on create
*
@@ -7842,66 +7806,4 @@ public function testRequiredOnUpdate() {
$this->assertTags($result, $expected);
}
/**
* Test inputDefaults setter and getter
*
* @return void
*/
public function testInputDefaults() {
$this->markTestIncomplete('Need to revisit once models work again.');
$this->Form->create('Contact');
$this->Form->inputDefaults(array(
'label' => false,
'div' => array(
'style' => 'color: #000;'
)
));
$result = $this->Form->input('Contact.field1');
$expected = array(
'div' => array('class' => 'input text', 'style' => 'color: #000;'),
'input' => array(
'type' => 'text', 'name' => 'Contact[field1]',
'id' => 'ContactField1'
),
'/div'
);
$this->assertTags($result, $expected);
$this->Form->inputDefaults(array(
'div' => false,
'label' => 'Label',
));
$result = $this->Form->input('Contact.field1');
$expected = array(
'label' => array('for' => 'ContactField1'),
'Label',
'/label',
'input' => array(
'type' => 'text', 'name' => 'Contact[field1]',
'id' => 'ContactField1'
),
);
$this->assertTags($result, $expected);
$this->Form->inputDefaults(array(
'label' => false,
), true);
$result = $this->Form->input('Contact.field1');
$expected = array(
'input' => array(
'type' => 'text', 'name' => 'Contact[field1]',
'id' => 'ContactField1'
),
);
$this->assertTags($result, $expected);
$result = $this->Form->inputDefaults();
$expected = array(
'div' => false,
'label' => false,
);
$this->assertEquals($expected, $result);
}
}

0 comments on commit f435997

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