function BulkFormTest::testConfirmRouteWithParameters

Same name in other branches
  1. 11.x core/modules/views/tests/src/Functional/BulkFormTest.php \Drupal\Tests\views\Functional\BulkFormTest::testConfirmRouteWithParameters()

Tests that route parameters are passed to the confirmation form route.

File

core/modules/views/tests/src/Functional/BulkFormTest.php, line 249

Class

BulkFormTest
Tests the views bulk form test.

Namespace

Drupal\Tests\views\Functional

Code

public function testConfirmRouteWithParameters() : void {
    $session = $this->getSession();
    $page = $session->getPage();
    $assert = $this->assertSession();
    $node = $this->createNode();
    // Access the view page.
    $this->drupalGet('/node/' . $node->id() . '/test_bulk_form');
    // Select a node and perform the 'Test action'.
    $page->checkField('node_bulk_form[0]');
    $page->selectFieldOption('Action', 'Test action');
    $page->pressButton('Apply to selected items');
    // Check that we've been landed on the confirmation form.
    $assert->pageTextContains('Do you agree?');
    // Check that route parameters were passed to the confirmation from route.
    $assert->addressEquals('/node/' . $node->id() . '/confirm');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.