You are here

public function DateFieldTestCase::testRelativeDefault in Date 7.3

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

Test relative default values.

File

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

Class

DateFieldTestCase
Test the handling of the two included field widgets.

Code

public function testRelativeDefault() {
  $this
    ->drupalGet('admin/structure/types/add');
  $this
    ->assertResponse(200);
  $edit = array();
  $edit['name'] = 'Date Relative Default Test';
  $edit['type'] = 'date_relative_default_test';
  $this
    ->drupalPost(NULL, $edit, t('Save content type'));
  $this
    ->assertResponse(200);
  $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);
  $this
    ->drupalGet('node/add/date-relative-default-test');
  $this
    ->assertResponse(200);
  $edit = array();
  $edit['title'] = self::randomName(8);
  $this
    ->drupalPost(NULL, $edit, t('Save'));
  $this
    ->assertResponse(200);
}