You are here

public function SettingsFormTest::testWithTokenModule in Node Option Premium 8

Tests settings form with token module enabled.

File

tests/src/Functional/Form/SettingsFormTest.php, line 195

Class

SettingsFormTest
Tests configuring the module.

Namespace

Drupal\Tests\nopremium\Functional\Form

Code

public function testWithTokenModule() {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('/admin/config/content/nopremium');
  $this
    ->assertSession()
    ->pageTextContains('Enable the Token module to view the available token browser.');
  $this
    ->assertSession()
    ->linkExists('Token module');

  // Now install the token module.
  $this->container
    ->get('module_installer')
    ->install([
    'token',
  ], TRUE);
  $this
    ->drupalGet('/admin/config/content/nopremium');
  $this
    ->assertSession()
    ->linkExists('Browse available tokens.');
}