mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
added testcases for time and datetime-fields
both have set their length field and should be displayed as text-inputs
This commit is contained in:
parent
0de87cd74e
commit
e0682fc8a1
1 changed files with 51 additions and 0 deletions
|
@ -66,6 +66,8 @@ class Contact extends CakeTestModel {
|
|||
'email' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
||||
'phone' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
||||
'password' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
||||
'lap_time' => array('type' => 'time', 'null' => '', 'default' => '', 'length' => '2'),
|
||||
'last_seen' => array('type' => 'datetime', 'null' => '', 'default' => '', 'length' => '3'),
|
||||
'published' => array('type' => 'date', 'null' => true, 'default' => null, 'length' => null),
|
||||
'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
|
||||
'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null),
|
||||
|
@ -3344,6 +3346,10 @@ class FormHelperTest extends CakeTestCase {
|
|||
'*/div',
|
||||
array('div' => array('class' => 'input password')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input time')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input datetime')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
|
@ -3369,6 +3375,10 @@ class FormHelperTest extends CakeTestCase {
|
|||
'*/div',
|
||||
array('div' => array('class' => 'input password')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input time')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input datetime')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
|
@ -3399,6 +3409,10 @@ class FormHelperTest extends CakeTestCase {
|
|||
'*/div',
|
||||
array('div' => array('class' => 'input password')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input time')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input datetime')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
|
@ -3425,6 +3439,10 @@ class FormHelperTest extends CakeTestCase {
|
|||
'*/div',
|
||||
array('div' => array('class' => 'input password')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input time')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input datetime')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
|
@ -3458,6 +3476,10 @@ class FormHelperTest extends CakeTestCase {
|
|||
'*/div',
|
||||
array('div' => array('class' => 'input password')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input time')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input datetime')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
|
@ -3488,6 +3510,10 @@ class FormHelperTest extends CakeTestCase {
|
|||
'*/div',
|
||||
array('div' => array('class' => 'input password')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input time')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input datetime')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
'*/div',
|
||||
array('div' => array('class' => 'input date')),
|
||||
|
@ -7678,6 +7704,31 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertContains('value="2008" selected="selected"', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testInputTimeWithMicrosecondsAsText method
|
||||
*
|
||||
* since times and datetimes can now have a Length, specifying the microsecond
|
||||
* precision, a text-type input shouldn't have set a maxLength attribute.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testInputTimeWithMicrosecondsAsText() {
|
||||
$this->Form->request->data = array();
|
||||
$this->Form->create('Contact');
|
||||
$result = $this->Form->input('lap_time',
|
||||
array(
|
||||
'type' => 'text',
|
||||
)
|
||||
);
|
||||
$this->assertNotContains('maxlength=', $result);
|
||||
$result = $this->Form->input('last_seen',
|
||||
array(
|
||||
'type' => 'text',
|
||||
)
|
||||
);
|
||||
$this->assertNotContains('maxlength=', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testTextArea method
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue