Permalink
Browse files

MDL-53796 behat: Move get_debug_text to base class

  • Loading branch information...
dmonllao committed Apr 13, 2016
1 parent b611ade commit 8918a8115e95e42f25ad3e409094aa6c8b67bbb7
Showing with 13 additions and 13 deletions.
  1. +13 −0 lib/behat/behat_base.php
  2. +0 −13 lib/tests/behat/behat_hooks.php
View
@@ -804,6 +804,19 @@ public function look_for_exceptions() {
}
}
/**
* 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.
*
@@ -504,19 +504,6 @@ public function i_look_for_exceptions() {
$this->look_for_exceptions();
}
/**
* 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
*

0 comments on commit 8918a81

Please sign in to comment.