You are here

protected function DateFieldBase::setUp in Date 8

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

@todo.

Overrides WebTestBase::setUp

File

lib/Drupal/date/Tests/DateFieldBase.php, line 23
Basic functions for Date tests.

Class

DateFieldBase

Namespace

Drupal\date\Tests

Code

protected function setUp() {
  parent::setUp();

  // Create and log in our privileged user.
  $this->privileged_user = $this
    ->drupalCreateUser(array(
    'administer content types',
    'administer nodes',
    'bypass node access',
    'administer date tools',
  ));
  $this
    ->drupalLogin($this->privileged_user);
  config('date_popup.settings')
    ->set('timepicker', 'none')
    ->save();
  module_load_include('inc', 'node', 'content_types');
  module_load_include('inc', 'node', 'node.pages');
  module_load_include('inc', 'field', 'field.crud');
  module_load_include('inc', 'date', 'date_admin');
  $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.');
}