You are here

public function NodeViewCountSettingsFormTest::testDefaultSettings in Node view count 8

Tests that default settings displayed right on the form.

File

src/Tests/NodeViewCountSettingsFormTest.php, line 19

Class

NodeViewCountSettingsFormTest
Tests settings form of nodeviewcount module.

Namespace

Drupal\nodeviewcount\Tests

Code

public function testDefaultSettings() {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/config/content/nodeviewcount');
  $this
    ->assertFieldChecked('edit-node-types-tracked-page');
  $this
    ->assertNoFieldChecked('edit-node-types-not-tracked-page');
  $this
    ->assertFieldChecked('edit-view-modes-full');
  $this
    ->assertFieldChecked('edit-view-modes-teaser');
  $this
    ->assertFieldChecked('edit-user-roles-anonymous');
  $this
    ->assertFieldChecked('edit-user-roles-logged');
  $this
    ->assertNoFieldChecked('edit-user-roles-authenticated');
  $this
    ->assertNoFieldById('edit-user-roles-administrator');
  $this
    ->assertNoFieldById('edit-excluded-user-roles-anonymous');
  $this
    ->assertNoFieldById('edit-excluded-user-roles-logged');
  $this
    ->assertNoFieldChecked('edit-excluded-user-roles-authenticated');
  $this
    ->assertFieldChecked('edit-excluded-user-roles-administrator');
  $this
    ->assertOptionSelected('edit-logs-life-time', 0);
  $this
    ->drupalLogout();
}