diff --git a/lib/behat/behat_base.php b/lib/behat/behat_base.php index 9bfead49f90..645fe90104d 100644 --- a/lib/behat/behat_base.php +++ b/lib/behat/behat_base.php @@ -773,6 +773,19 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext { // If we were interacting with a popup window it will not exists after closing it. } } + /** + * Converts HTML tags to line breaks to display the info in CLI + * + * @param string $html + * @return string + */ + protected function get_debug_text($html) { + + // Replacing HTML tags for new lines and keeping only the text. + $notags = preg_replace('/<+\s*\/*\s*([A-Z][A-Z0-9]*)\b[^>]*\/*\s*>*/i', "\n", $html); + return preg_replace("/(\n)+/s", "\n", $notags); + } + /** * Helper function to execute api in a given context. * diff --git a/lib/tests/behat/behat_hooks.php b/lib/tests/behat/behat_hooks.php index 598b98260b1..b9a368d7beb 100644 --- a/lib/tests/behat/behat_hooks.php +++ b/lib/tests/behat/behat_hooks.php @@ -511,19 +511,6 @@ class behat_hooks extends behat_base { } - /** - * Converts HTML tags to line breaks to display the info in CLI - * - * @param string $html - * @return string - */ - protected function get_debug_text($html) { - - // Replacing HTML tags for new lines and keeping only the text. - $notags = preg_replace('/<+\s*\/*\s*([A-Z][A-Z0-9]*)\b[^>]*\/*\s*>*/i', "\n", $html); - return preg_replace("/(\n)+/s", "\n", $notags); - } - /** * Returns whether the first scenario of the suite is running *