You are here

UiPageTest.php in Config Pages 8.3

Same filename and directory in other branches
  1. 8.2 tests/src/Functional/UiPageTest.php

File

tests/src/Functional/UiPageTest.php
View source
<?php

namespace Drupal\config_pages\tests\Functional;

use Drupal\Tests\BrowserTestBase;

/**
* Tests that the ConfigPages UI pages are reachable.
*
* @group config_pages
*/
class UiPageTest extends BrowserTestBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  protected static $modules = [
    'config_pages',
  ];

  /**
   * Tests that the ConfigPages listing page works.
   */
  public function testConfigPagesPage() {
    $account = $this
      ->drupalCreateUser([
      'access config_pages overview',
    ]);
    $this
      ->drupalLogin($account);
    $this
      ->drupalGet('admin/structure/config_pages');
    $this
      ->assertSession()
      ->statusCodeEquals(200);

    // Test that there is an empty reaction rule listing.
    $this
      ->assertSession()
      ->pageTextContains('There is no Config page yet.');
  }

  /**
   * Tests that the ConfigPages types listing page works.
   */
  public function testConfigPagesTypesPage() {
    $account = $this
      ->drupalCreateUser([
      'administer config_pages types',
    ]);
    $this
      ->drupalLogin($account);
    $this
      ->drupalGet('admin/structure/config_pages/types');
    $this
      ->assertSession()
      ->statusCodeEquals(200);

    // Test that there is an empty reaction rule listing.
    $this
      ->assertSession()
      ->pageTextContains('There is no Config page type yet.');
  }

}

Classes

Namesort descending Description
UiPageTest Tests that the ConfigPages UI pages are reachable.