More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / tests / Drupal / Tests / Listeners / SimpletestUiPrinter.php
1 <?php
2
3 namespace Drupal\Tests\Listeners;
4
5 use Drupal\Component\Utility\Html;
6
7 /**
8  * Defines a class for providing html output links in the Simpletest UI.
9  */
10 class SimpletestUiPrinter extends HtmlOutputPrinter {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function write($buffer) {
16     $buffer = Html::escape($buffer);
17     // Turn HTML output URLs into clickable link <a> tags.
18     $url_pattern = '@https?://[^\s]+@';
19     $buffer = preg_replace($url_pattern, '<a href="$0" target="_blank" title="$0">$0</a>', $buffer);
20     // Make the output readable in HTML by breaking up lines properly.
21     $buffer = nl2br($buffer);
22
23     print $buffer;
24   }
25
26 }