Skip to content

Commit

Permalink
Add another test for secure option + datetime fields.
Browse files Browse the repository at this point in the history
Refs #3573
  • Loading branch information
markstory committed May 27, 2014
1 parent 64e6337 commit 550f267
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -4261,6 +4261,23 @@ public function testDateTimeSecured() {
$this->assertEquals($expected, $this->Form->fields);
}

/**
* Test that datetime fields are added to protected fields list.
*
* @return void
*/
public function testDateTimeSecuredDisabled() {
$this->Form->request->params['_Token'] = ['unlockedFields' => []];
$this->Form->dateTime('Contact.date', ['secure' => false]);
$expected = [];
$this->assertEquals($expected, $this->Form->fields);

$this->Form->fields = [];
$this->Form->date('Contact.published', ['secure' => false]);
$expected = [];
$this->assertEquals($expected, $this->Form->fields);
}

/**
* Test empty defaulting to true for datetime.
*
Expand Down

0 comments on commit 550f267

Please sign in to comment.