You are here

public function MenuTest::testMenuLinks in Message Subscribe 8

Test that the menu links are working properly.

File

tests/src/Functional/MenuTest.php, line 23

Class

MenuTest
Tests menus for the message subscribe module.

Namespace

Drupal\Tests\message_subscribe\Functional

Code

public function testMenuLinks() {
  $admin = $this
    ->drupalCreateUser([], NULL, TRUE);
  $this
    ->drupalLogin($admin);

  // Link should appear on main config page.
  $this
    ->drupalGet(Url::fromRoute('system.admin_config'));
  $this
    ->assertSession()
    ->linkExists(t('Message subscribe settings'));

  // Link should be on the message-specific overview page.
  $this
    ->drupalGet(Url::fromRoute('message.main_settings'));
  $this
    ->assertSession()
    ->linkExists(t('Message subscribe settings'));
  $this
    ->clickLink(t('Message subscribe settings'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}