function WorkspacePublisherTest::nodePresave
Same name and namespace in other branches
- main core/modules/workspaces/tests/src/Kernel/WorkspacePublisherTest.php \Drupal\Tests\workspaces\Kernel\WorkspacePublisherTest::nodePresave()
Implements hook_ENTITY_TYPE_presave() for the 'node' entity type.
Attributes
#[Hook('node_presave')]
See also
::testPublishThrowableRollback()
File
-
core/
modules/ workspaces/ tests/ src/ Kernel/ WorkspacePublisherTest.php, line 183
Class
- WorkspacePublisherTest
- Tests workspace publishing.
Namespace
Drupal\Tests\workspaces\KernelCode
public function nodePresave(NodeInterface $node) : void {
if (!$this->throwOnNodePresaveClass) {
return;
}
$this->nodePresaveCount++;
if ($this->nodePresaveCount >= 2) {
throw new $this->throwOnNodePresaveClass('Simulated node presave failure.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.