function RngRegistrantRouteTest::testRegistrantCanonicalRoute in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/Tests/RngRegistrantRouteTest.php \Drupal\rng\Tests\RngRegistrantRouteTest::testRegistrantCanonicalRoute()
- 3.x src/Tests/RngRegistrantRouteTest.php \Drupal\rng\Tests\RngRegistrantRouteTest::testRegistrantCanonicalRoute()
Test access registrant canonical route.
File
- src/
Tests/ RngRegistrantRouteTest.php, line 112
Class
- RngRegistrantRouteTest
- Tests registrant routes.
Namespace
Drupal\rng\TestsCode
function testRegistrantCanonicalRoute() {
$admin = $this
->drupalCreateUser([
'administer rng',
]);
$this
->drupalLogin($admin);
$this
->drupalGet(Url::fromRoute('entity.registrant.canonical', [
'registrant' => $this->registrant
->id(),
]));
$this
->assertResponse(200);
$test_field_value = $this->registrant->{$this->registrantTestField}->value;
$this
->assertRaw($test_field_value);
// Breadcrumb.
$this
->assertLink(t('Home'));
$this
->assertLink($this->registrant
->getRegistration()
->getEvent()
->label());
$this
->assertLink($this->registrant
->getRegistration()
->label());
}