You are here

public function ForenaInegrationTest::testConfig in Forena Reports 8

Test the Configuration screens

File

src/Tests/ForenaInegrationTest.php, line 64
tests Tests for forena. @author davidmetzler

Class

ForenaInegrationTest
Class ForenaInegrationTest

Namespace

Drupal\forena\Tests

Code

public function testConfig() {
  if ($this->privileged_user) {
    $this
      ->drupalLogin($this->privileged_user);
  }

  // Navigation to configuration form
  $this
    ->drupalGet('admin/config');
  $this
    ->assertLink('Report Configuration');

  // Verify general configuration form
  $this
    ->clickLink('Report Configuration');
  $this
    ->assertField('default_skin', 'Default Skin');
  $this
    ->assertField('input_format', 'Input Format');

  // Verify list of Data Sources
  $this
    ->drupalGet('admin/config/content/forena/data');
  $this
    ->assertText('forena_help', 'Help data source exists');
  $this
    ->assertText('drupal', 'Drupal data source exists');
  $this
    ->assertLink('edit', 0, 'Edit link is available.');

  // Veriify Data Source save
  $this
    ->drupalGet('admin/config/content/forena/data/drupal');
  $this
    ->assertField('debug', 'Debug field Exists');
  $edit['debug'] = '1';
  $this
    ->drupalPostForm(NULL, $edit, t('Save'));
  $this
    ->assertFieldChecked('edit-debug');

  // @TODO: Email Configuration
}