You are here

function DateUITest::dateForm in Date 8

Same name in this branch
  1. 8 lib/Drupal/date/Tests/DateUITest.php \Drupal\date\Tests\DateUITest::dateForm()
  2. 8 date_field/lib/Drupal/date_field/Tests/DateUITest.php \Drupal\date\Tests\DateUITest::dateForm()

@todo.

2 calls to DateUITest::dateForm()
DateUITest::testFieldUI in lib/Drupal/date/Tests/DateUITest.php
@todo.
DateUITest::testFieldUI in date_field/lib/Drupal/date_field/Tests/DateUITest.php
@todo.

File

date_field/lib/Drupal/date_field/Tests/DateUITest.php, line 81
Test date UI.

Class

DateUITest

Namespace

Drupal\date\Tests

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