You are here

function DateToolsTest::createDateWizard in Date 8

Creates a date field using the Date Wizard.

1 call to DateToolsTest::createDateWizard()
DateToolsTest::testTools in date_tools/lib/Drupal/date_tools/Tests/DateToolsTest.php
Creates a date field using the Date Wizard.

File

date_tools/lib/Drupal/date_tools/Tests/DateToolsTest.php, line 94
Tests for Date Tools.

Class

DateToolsTest

Namespace

Drupal\date_tools\Tests

Code

function createDateWizard($edit) {
  $edit += array(
    'bundle' => 'story',
    'name' => 'Story',
    'type_description' => 'A test content type.',
    'field_name' => 'test',
    'label' => 'Test',
    'widget_type' => 'date_select',
    'todate' => 'optional',
    'field_type' => 'date',
    'granularity[]' => array(
      'year',
      'month',
      'day',
      'hour',
      'minute',
    ),
    'tz_handling' => 'site',
    'year_range' => '2010:+2',
  );
  $this
    ->drupalPost('admin/config/date/tools/date_wizard', $edit, t('Save'));
  $this
    ->assertText('Your date field Test has been created.', 'Create a date field using the Date Wizard.');
}