Commit c632cd68 authored by Sam152's avatar Sam152 Committed by Sam152

Issue #2665762 by Sam152: Add a basic smoke test for pager in the views admin

parent b2ac47fc
<?php
/**
* @file
* Contains Drupal\views_infinite_scroll\Tests\IntegrationSmokeTest.
*/
namespace Drupal\views_infinite_scroll\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Basic integration smoke test for the pager plugin.
*
* @group views_infinite_scroll
*/
class IntegrationSmokeTest extends WebTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['views', 'views_ui', 'views_infinite_scroll'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->drupalLogin($this->createUser(['administer views']));
}
/**
* Test the views plugin.
*/
public function testPlugin() {
$this->drupalPostForm('admin/structure/views/add', [
'label' => 'Test Plugin',
'id' => 'test_plugin',
'page[create]' => '1',
'page[title]' => 'Test Plugin',
'page[path]' => 'test-plugin',
], 'Save and edit');
$this->clickLink('Full');
$this->drupalPostForm(NULL, [
'pager[type]' => 'infinite_scroll',
], 'Apply');
$this->drupalPostForm(NULL, [
'pager_options[views_infinite_scroll][button_text]' => 'More Please',
'pager_options[views_infinite_scroll][automatically_load_content]' => '',
], 'Apply');
$this->assertLink('Infinite Scroll');
$this->assertText('Automatic infinite scroll, 10 items');
$this->drupalPostForm(NULL, [], 'Save');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment