Skip to content
Permalink
Browse files

Deleting test method tht was duplicating several other tests

  • Loading branch information...
lorenzo committed Feb 27, 2014
1 parent e34e917 commit 30f4fc80f59cca223fa3510e39913ff17c817c9a
Showing with 0 additions and 137 deletions.
  1. +0 −137 tests/TestCase/View/Helper/FormHelperTest.php
@@ -5835,143 +5835,6 @@ public function testDateTimeWithGetForms() {
$this->assertContains('name="created[meridian]"', $result, 'meridian name attribute is wrong.');
}
/**
* testFormMagicInput method
*
* @return void
*/
public function testFormMagicInput() {
$this->markTestIncomplete('Need to revisit once models work again.');
$encoding = strtolower(Configure::read('App.encoding'));
TableRegistry::get('Contacts', [
'className' => __NAMESPACE__ . '\ContactsTable'
]);
$result = $this->Form->create([], ['context' => ['table' => 'Contacts']]);
$expected = array(
'form' => array(
'method' => 'post', 'action' => '/articles/add',
'accept-charset' => $encoding
),
'div' => array('style' => 'display:none;'),
'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
'/div'
);
$this->assertTags($result, $expected);
$result = $this->Form->input('name');
$expected = array(
'div' => array('class' => 'input text'),
'label' => array('for' => 'name'),
'Name',
'/label',
'input' => array(
'type' => 'text', 'name' => 'name',
'id' => 'name', 'maxlength' => '255'
),
'/div'
);
$this->assertTags($result, $expected);
$result = $this->Form->input('non_existing_field_in_contact_model');
$expected = array(
'div' => array('class' => 'input text'),
'label' => array('for' => 'non-existing-field-in-contact-model'),
'Non Existing Field In Contact Model',
'/label',
'input' => array(
'type' => 'text', 'name' => 'non_existing_field_in_contact_model',
'id' => 'non-existing-field-in-contact-model'
),
'/div'
);
$this->assertTags($result, $expected);
extract($this->dateRegex);
$now = strtotime('now');
$result = $this->Form->input('Contact.published', array(
'templates' => ['groupContainer' => '{{label}}{{input}}']
));
$expected = array(
'label' => array('for' => 'ContactPublishedMonth'),
'Published',
'/label',
array('select' => array(
'name' => 'Contact[published][month]', 'id' => 'ContactPublishedMonth'
)),
$monthsRegex,
array('option' => array('value' => date('m', $now), 'selected' => 'selected')),
date('F', $now),
'/option',
'*/select',
'-',
array('select' => array(
'name' => 'Contact[published][day]', 'id' => 'ContactPublishedDay'
)),
$daysRegex,
array('option' => array('value' => date('d', $now), 'selected' => 'selected')),
date('j', $now),
'/option',
'*/select',
'-',
array('select' => array(
'name' => 'Contact[published][year]', 'id' => 'ContactPublishedYear'
)),
$yearsRegex,
array('option' => array('value' => date('Y', $now), 'selected' => 'selected')),
date('Y', $now),
'*/select'
);
$this->assertTags($result, $expected);
$result = $this->Form->input('Contact.updated', array('div' => false));
$expected = array(
'label' => array('for' => 'ContactUpdatedMonth'),
'Updated',
'/label',
array('select' => array(
'name' => 'Contact[updated][month]', 'id' => 'ContactUpdatedMonth'
)),
$monthsRegex,
array('option' => array('value' => date('m', $now), 'selected' => 'selected')),
date('F', $now),
'/option',
'*/select',
'-',
array('select' => array(
'name' => 'Contact[updated][day]', 'id' => 'ContactUpdatedDay'
)),
$daysRegex,
array('option' => array('value' => date('d', $now), 'selected' => 'selected')),
date('j', $now),
'/option',
'*/select',
'-',
array('select' => array(
'name' => 'Contact[updated][year]', 'id' => 'ContactUpdatedYear'
)),
$yearsRegex,
array('option' => array('value' => date('Y', $now), 'selected' => 'selected')),
date('Y', $now),
'*/select'
);
$this->assertTags($result, $expected);
$result = $this->Form->input('UserForm.stuff');
$expected = array(
'div' => array('class' => 'input text'),
'label' => array('for' => 'UserFormStuff'),
'Stuff',
'/label',
'input' => array(
'type' => 'text', 'name' => 'UserForm[stuff]',
'id' => 'UserFormStuff', 'maxlength' => 10
),
'/div'
);
$this->assertTags($result, $expected);
}
/**
* testForMagicInputNonExistingNorValidated method
*

0 comments on commit 30f4fc8

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