protected function LingotekNodeNotificationCallbackQueueWorkerTest::resetStorageCachesAndReloadNode in Lingotek Translation 8.2
Same name and namespace in other branches
- 3.0.x tests/src/Functional/LingotekNodeNotificationCallbackQueueWorkerTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackQueueWorkerTest::resetStorageCachesAndReloadNode()
- 3.1.x tests/src/Functional/LingotekNodeNotificationCallbackQueueWorkerTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackQueueWorkerTest::resetStorageCachesAndReloadNode()
- 3.2.x tests/src/Functional/LingotekNodeNotificationCallbackQueueWorkerTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackQueueWorkerTest::resetStorageCachesAndReloadNode()
- 3.3.x tests/src/Functional/LingotekNodeNotificationCallbackQueueWorkerTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackQueueWorkerTest::resetStorageCachesAndReloadNode()
Resets node and metadata storage caches and reloads the node.
Return value
\Drupal\node\NodeInterface The node.
1 call to LingotekNodeNotificationCallbackQueueWorkerTest::resetStorageCachesAndReloadNode()
- LingotekNodeNotificationCallbackQueueWorkerTest::testAutomatedNotificationNodeTranslation in tests/
src/ Functional/ LingotekNodeNotificationCallbackQueueWorkerTest.php - Tests that a node can be translated using the links on the management page.
File
- tests/
src/ Functional/ LingotekNodeNotificationCallbackQueueWorkerTest.php, line 417
Class
- LingotekNodeNotificationCallbackQueueWorkerTest
- Tests translating a node using the notification callback with a queue worker.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function resetStorageCachesAndReloadNode() {
/** @var \Drupal\node\NodeStorageInterface $node_storage */
$node_storage = $this->container
->get('entity_type.manager')
->getStorage('node');
/** @var \Drupal\Core\Entity\EntityStorageInterface; $metadata_storage */
$metadata_storage = $this->container
->get('entity_type.manager')
->getStorage('lingotek_content_metadata');
// The node and the metadata caches need to be reset before reload.
$metadata_storage
->resetCache([
1,
]);
$node_storage
->resetCache([
1,
]);
/** @var \Drupal\node\NodeInterface $node */
$node = $node_storage
->load(1);
return $node;
}