You are here

public function PagererTest::testPagerer in Pagerer 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/PagererTest.php \Drupal\Tests\pagerer\Functional\PagererTest::testPagerer()

Tests Pagerer functionality.

File

tests/src/Functional/PagererTest.php, line 39

Class

PagererTest
Checks Pagerer functionality.

Namespace

Drupal\Tests\pagerer\Functional

Code

public function testPagerer() {

  // Admin UI tests.
  $edit = [
    'label' => 'ui_test',
    'id' => 'ui_test',
  ];
  $this
    ->drupalPostForm($this->pagererAdmin . '/preset/add', $edit, 'Create');
  $edit = [
    'core_override_preset' => 'ui_test',
  ];
  $this
    ->drupalPostForm($this->pagererAdmin, $edit, 'Save configuration');
  $styles = [
    'standard',
    'none',
    'basic',
    'progressive',
    'adaptive',
    'mini',
    'slider',
    'scrollpane',
  ];
  foreach ($styles as $style) {
    $this
      ->drupalGet($this->pagererAdmin . '/preset/manage/ui_test');
    $edit = [
      'panes_container[left][style]' => 'none',
      'panes_container[center][style]' => 'none',
      'panes_container[right][style]' => $style,
    ];
    $this
      ->drupalPostForm(NULL, $edit, 'Save');
    $this
      ->drupalGet($this->pagererAdmin . '/preset/manage/ui_test');
    if ($style !== 'none') {
      $this
        ->click('[id="edit-panes-container-right-actions-reset"]');
      $this
        ->click('[id="edit-submit"]');
      $this
        ->assertNoRaw('fooxiey');
      $this
        ->click('[id="edit-panes-container-right-actions-configure"]');
      $edit = [
        'prefix_display' => '1',
        'tags_container[pages][prefix_label]' => 'fooxiey',
      ];
      $this
        ->drupalPostForm(NULL, $edit, 'Save');
      $this
        ->assertRaw('fooxiey');
    }
  }

  // Load example page.
  $this
    ->drupalGet('pagerer/example');
}