You are here

AnwsersTest.php in Answers 8

File

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

namespace Drupal\Tests\answers\Functional;

use Drupal\Tests\BrowserTestBase;

/**
 * Tests that the Rules UI pages are reachable.
 *
 * @group Answers
 */
class AnswersTest extends BrowserTestBase {

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

  /**
   * We use the minimal profile because we want to test local action links.
   *
   * @var string
   */

  // protected $profile = 'minimal';

  /**
   * Tests that the reaction rule listing page works.
   */
  public function testAddContentPage() {
    $account = $this
      ->drupalCreateUser();
    $this
      ->drupalLogin($account);
    $this
      ->drupalGet('node/add/answers-question');
    $this
      ->assertSession()
      ->statusCodeEquals(200);

    // Test that there is an empty reaction rule listing.
    // @todo In Drupal 8.6.x the text changed from 'There is no Reaction Rule'
    // to 'There are no reaction rules'. Remove this once 8.5.x is unsupported.
    // @see https://www.drupal.org/project/rules/issues/2989050
    // if (version_compare(substr(\Drupal::VERSION, 0, 3), '8.6', '>=')) {
    //   $this->assertSession()->pageTextContains('There are no reaction rules yet.');
    // }
    // else {
    //   $this->assertSession()->pageTextContains('There is no Reaction Rule yet.');
    // }
  }

}

Classes

Namesort descending Description
AnswersTest Tests that the Rules UI pages are reachable.