function DateUITestCase::dateForm in Date 7
Same name and namespace in other branches
- 7.3 tests/DateUiTestCase.test \DateUiTestCase::dateForm()
- 7.2 tests/DateUiTestCase.test \DateUiTestCase::dateForm()
1 call to DateUITestCase::dateForm()
- DateUITestCase::testFieldUI in tests/
date.test
File
- tests/
date.test, line 98
Class
Code
function dateForm($options) {
// Tests that date field functions properly.
$edit = array();
$edit['title'] = $this
->randomName(8);
$edit['body[und][0][value]'] = $this
->randomName(16);
if ($options == 'select') {
$edit['field_test[und][0][value][year]'] = '2010';
$edit['field_test[und][0][value][month]'] = '10';
$edit['field_test[und][0][value][day]'] = '7';
$edit['field_test[und][0][value][hour]'] = '10';
$edit['field_test[und][0][value][minute]'] = '30';
}
elseif ($options == 'text') {
$edit['field_test[und][0][value][date]'] = '10/07/2010 - 10:30';
}
elseif ($options == 'popup') {
$edit['field_test[und][0][value][date]'] = '10/07/2010';
$edit['field_test[und][0][value][time]'] = '10:30';
}
$this
->drupalPost('node/add/story', $edit, t('Save'));
$this
->assertText($edit['body[und][0][value]'], 'Test node has been created');
}