public function FormModeManagerRouteTest::testListWithOneFormModeManagerRoutes in Form mode manager 8.2
Same name and namespace in other branches
- 8 tests/src/Functional/FormModeManagerRouteTest.php \Drupal\Tests\form_mode_manager\Functional\FormModeManagerRouteTest::testListWithOneFormModeManagerRoutes()
Asserts List With One Form Mode Manager routes exists.
Throws
\Behat\Mink\Exception\ExpectationException
File
- tests/
src/ Functional/ FormModeManagerRouteTest.php, line 197
Class
- FormModeManagerRouteTest
- Tests the routes generated by form_mode_manager.
Namespace
Drupal\Tests\form_mode_manager\FunctionalCode
public function testListWithOneFormModeManagerRoutes() {
$this
->drupalLogin($this->adminUser);
$node_form_mode_id = $this->formModeManager
->getFormModeMachineName($this->nodeFormMode
->id());
$this
->drupalGet("node/add-list/{$node_form_mode_id}");
$this
->assertSession()
->titleEquals("Create {$this->nodeTypeFmm1->id()} as {$this->nodeFormMode->label()} | Drupal");
$this
->assertSession()
->statusCodeEquals(200);
// List form mode for anonymous.
$this
->drupalLogin($this->anonymousUser);
$this
->drupalGet("node/add-list/{$node_form_mode_id}");
$this
->assertSession()
->statusCodeEquals(403);
// List form mode not exit.
$this
->drupalLogin($this->adminUser);
$this
->drupalGet("node/add-list/not-valid-fm");
$this
->assertSession()
->statusCodeEquals(404);
}