Permalink
Browse files

MDL-53796 behat: Move get_debug_text to base class

  • Loading branch information...
dmonllao committed Apr 13, 2016
1 parent 98eb681 commit 256cd103baeffdce9c613bb9679850cdd775f3fd
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
@@ -773,6 +773,19 @@ public function look_for_exceptions() {
// 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.
*
@@ -511,19 +511,6 @@ public function i_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 256cd10

Please sign in to comment.