You are here

public function DateValidationTestCase::testValidation in Date 7

Same name and namespace in other branches
  1. 7.3 tests/DateValidationTestCase.test \DateValidationTestCase::testValidation()
  2. 7.2 tests/DateValidationTestCase.test \DateValidationTestCase::testValidation()

File

tests/date_validation.test, line 26

Class

DateValidationTestCase

Code

public function testValidation() {
  $edit = array();
  $edit['name'] = 'Story';
  $edit['type'] = 'story';
  $this
    ->drupalPost('admin/structure/types/add', $edit, t('Save content type'));
  $this
    ->assertText('The content type Story has been added.', 'Content type added.');

  // Attempts to create text date field stored as a date with default settings (from input which is not valid).
  $this
    ->createDateField($type = 'date', $widget = 'date_text');
  $edit = array();
  $this
    ->drupalPost(NULL, $edit, t('Save field settings'));
  $this
    ->malFormedDate($options = 'text');
  $this
    ->deleteDateField();
}