diff --git a/src/Palantirnet/PalantirBehatExtension/Context/DrupalAutoNodetitleContext.php b/src/Palantirnet/PalantirBehatExtension/Context/DrupalAutoNodetitleContext.php new file mode 100644 index 0000000..d7f7050 --- /dev/null +++ b/src/Palantirnet/PalantirBehatExtension/Context/DrupalAutoNodetitleContext.php @@ -0,0 +1,46 @@ +disableAutoNodetitle = TRUE; + } + + /** + * @BeforeNodeCreate + */ + public function prepareAutoNodetitleNode(BeforeNodeCreateScope $scope) + { + if ($this->disableAutoNodetitle) { + $node = $scope->getEntity(); + $node->auto_nodetitle_applied = TRUE; + } + } + +} diff --git a/src/Palantirnet/PalantirBehatExtension/Context/DrupalWorkbenchModerationContext.php b/src/Palantirnet/PalantirBehatExtension/Context/DrupalWorkbenchModerationContext.php new file mode 100644 index 0000000..0f98b9d --- /dev/null +++ b/src/Palantirnet/PalantirBehatExtension/Context/DrupalWorkbenchModerationContext.php @@ -0,0 +1,50 @@ +disableWorkbenchModeration = TRUE; + } + + /** + * @BeforeNodeCreate + */ + public function prepareWorkbenchModerationNode(BeforeNodeCreateScope $scope) + { + if ($this->disableWorkbenchModeration) { + $node = $scope->getEntity(); + $node->status = 1; + + // This is a hack; workbench_moderation_node_update() will return + // without applying moderation if it thinks that it is being called + // recursively. + $node->updating_live_revision = 'behat_skip'; + } + } + +}