You are here

public function RngRegistrantRouteTest::testRegistrantEditRoute in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/Tests/RngRegistrantRouteTest.php \Drupal\rng\Tests\RngRegistrantRouteTest::testRegistrantEditRoute()
  2. 8 src/Tests/RngRegistrantRouteTest.php \Drupal\rng\Tests\RngRegistrantRouteTest::testRegistrantEditRoute()

Test access edit registrant form.

File

src/Tests/RngRegistrantRouteTest.php, line 144

Class

RngRegistrantRouteTest
Tests registrant routes.

Namespace

Drupal\rng\Tests

Code

public function testRegistrantEditRoute() {
  $admin = $this
    ->drupalCreateUser([
    'administer rng',
  ]);
  $this
    ->drupalLogin($admin);
  $this
    ->drupalGet(Url::fromRoute('entity.registrant.edit_form', [
    'registrant' => $this->registrant
      ->id(),
  ]));
  $this
    ->assertResponse(200);
  $this
    ->assertFieldByName($this->registrantTestField . '[0][value]');

  // Breadcrumb.
  $this
    ->assertLink(t('Home'));
  $this
    ->assertLink($this->registrant
    ->getRegistration()
    ->getEvent()
    ->label());
  $this
    ->assertLink($this->registrant
    ->getRegistration()
    ->label());
  $this
    ->assertLink($this->registrant
    ->label());
}