You are here

public function RngEventSettingsTest::testEventSettingsTabs in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/Tests/RngEventSettingsTest.php \Drupal\rng\Tests\RngEventSettingsTest::testEventSettingsTabs()
  2. 3.x src/Tests/RngEventSettingsTest.php \Drupal\rng\Tests\RngEventSettingsTest::testEventSettingsTabs()

Tests canonical event page, and the Event default local task.

File

src/Tests/RngEventSettingsTest.php, line 80

Class

RngEventSettingsTest
Tests event settings page.

Namespace

Drupal\rng\Tests

Code

public function testEventSettingsTabs() {
  $account = $this
    ->drupalCreateUser([
    'edit own ' . $this->event_bundle
      ->id() . ' content',
  ]);
  $this
    ->drupalLogin($account);
  $event = $this
    ->createEntity($this->event_bundle);

  // Local task appears on canonical route.
  $base_url = 'node/1';
  $this
    ->drupalGet($event
    ->urlInfo());
  $this
    ->assertLinkByHref($base_url . '/event');

  // Event settings form.
  $this
    ->drupalGet('node/1/event');
  $this
    ->assertLink('Settings');
  $this
    ->assertLinkByHref($base_url . '/event/access');
  $this
    ->assertLinkByHref($base_url . '/event/messages');
  $this
    ->assertLinkByHref($base_url . '/event/groups');
}