You are here

function DateToolsTestCase::dateForm in Date 7

Same name and namespace in other branches
  1. 7.3 date_tools/tests/DateToolsTestCase.test \DateToolsTestCase::dateForm()
  2. 7.2 date_tools/tests/DateToolsTestCase.test \DateToolsTestCase::dateForm()
1 call to DateToolsTestCase::dateForm()
DateToolsTestCase::testTools in date_tools/tests/date_tools.test

File

date_tools/tests/date_tools.test, line 36

Class

DateToolsTestCase

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');
}