From 5aea409a87a3e62b3f6f5b1827cbb778fc4d979c Mon Sep 17 00:00:00 2001 From: David Woloszyn Date: Tue, 4 Jul 2023 19:18:21 +1000 Subject: [PATCH] MDL-78553 behat: Add disable communication helper trait --- communication/tests/behat/behat_communication.php | 9 +++++++++ communication/tests/communication_test_helper_trait.php | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/communication/tests/behat/behat_communication.php b/communication/tests/behat/behat_communication.php index 72350fc857b..c3f3bd5e8a8 100644 --- a/communication/tests/behat/behat_communication.php +++ b/communication/tests/behat/behat_communication.php @@ -37,4 +37,13 @@ class behat_communication extends \behat_base { public function enable_communication_experimental_feature(): void { $this->setup_communication_configs(); } + + /** + * Disable communication experimental feature. + * + * @Given /^I disable communication experimental feature$/ + */ + public function disable_communication_experimental_feature(): void { + $this->disable_communication_configs(); + } } diff --git a/communication/tests/communication_test_helper_trait.php b/communication/tests/communication_test_helper_trait.php index 2fb398881fa..d63ac6614db 100644 --- a/communication/tests/communication_test_helper_trait.php +++ b/communication/tests/communication_test_helper_trait.php @@ -35,6 +35,15 @@ trait communication_test_helper_trait { set_config('enablecommunicationsubsystem', 1); } + /** + * Disable configs for communication subsystem. + * + * @return void + */ + protected function disable_communication_configs(): void { + set_config('enablecommunicationsubsystem', 0); + } + /** * Get or create course if it does not exist *