function CToolsViewsBasicViewBlockTest::testBasic

Test basic view with ctools_views module enabled but no options set.

File

modules/ctools_views/tests/src/Functional/CToolsViewsBasicViewBlockTest.php, line 58

Class

CToolsViewsBasicViewBlockTest
Tests ctools_views block display plugin overrides settings from a basic View.

Namespace

Drupal\Tests\ctools_views\Functional

Code

public function testBasic() {
    $default_theme = $this->config('system.theme')
        ->get('default');
    // Get the "Configure block" form for our Views block.
    $this->drupalGet('admin/structure/block/add/views_block:ctools_views_test_view-block_basic/' . $default_theme);
    // Add block to sidebar_first region with default settings.
    $edit = [];
    $edit['region'] = 'sidebar_first';
    $this->drupalGet('admin/structure/block/add/views_block:ctools_views_test_view-block_basic/' . $default_theme);
    $this->submitForm($edit, 'Save block');
    // Assert items per page default settings.
    $this->drupalGet('<front>');
    $result = $this->xpath('//div[contains(@class, "region-sidebar-first")]/div[contains(@class, "block-views")]/h2');
    $this->assertSession()
        ->fieldExists('status');
    $this->assertSession()
        ->fieldExists('job');
    $this->assertSession()
        ->buttonExists('Apply');
}