function BulkFormTest::loadNode

Same name in other branches
  1. 9 core/modules/node/tests/src/Functional/Views/BulkFormTest.php \Drupal\Tests\node\Functional\Views\BulkFormTest::loadNode()
  2. 8.9.x core/modules/node/tests/src/Functional/Views/BulkFormTest.php \Drupal\Tests\node\Functional\Views\BulkFormTest::loadNode()
  3. 10 core/modules/node/tests/src/Functional/Views/BulkFormTest.php \Drupal\Tests\node\Functional\Views\BulkFormTest::loadNode()

Load the specified node from the storage.

Parameters

int $id: The node identifier.

Return value

\Drupal\node\NodeInterface The loaded node.

2 calls to BulkFormTest::loadNode()
BulkFormTest::testBulkDeletion in core/modules/node/tests/src/Functional/Views/BulkFormTest.php
Tests multiple deletion.
BulkFormTest::testBulkForm in core/modules/node/tests/src/Functional/Views/BulkFormTest.php
Tests the node bulk form.

File

core/modules/node/tests/src/Functional/Views/BulkFormTest.php, line 295

Class

BulkFormTest
Tests a node bulk form.

Namespace

Drupal\Tests\node\Functional\Views

Code

protected function loadNode($id) {
    
    /** @var \Drupal\node\NodeStorage $storage */
    $storage = $this->container
        ->get('entity_type.manager')
        ->getStorage('node');
    $storage->resetCache([
        $id,
    ]);
    return $storage->load($id);
}

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