You are here

public function DateFieldTestCase::testRelativeDefault in Date 7.2

Same name and namespace in other branches
  1. 7.3 tests/DateFieldTestCase.test \DateFieldTestCase::testRelativeDefault()

Test relative default values.

File

tests/DateFieldTestCase.test, line 16
Test the handling of the two included field widgets.

Class

DateFieldTestCase
Test the handling of the two included field widgets.

Code

public function testRelativeDefault() {
  $edit = array();
  $edit['name'] = 'Date Relative Default Test';
  $edit['type'] = 'date_relative_default_test';
  $this
    ->drupalPost('admin/structure/types/add', $edit, t('Save content type'));
  $this
    ->assertText('The content type Date Relative Default Test has been added.', 'Content type added.');
  $options = array(
    'bundle' => 'date_relative_default_test',
    'default_value' => 'strtotime',
    'default_value_code' => '+1',
  );
  $this
    ->createDateField($options);
  $edit = array();
  $edit['title'] = self::randomName(8);
  $this
    ->drupalPost('node/add/date-relative-default-test', $edit, t('Save'));
}