SimpletestUiPrinterTest.php in Drupal 8
File
core/modules/simpletest/tests/src/Unit/SimpletestUiPrinterTest.php
View source
<?php
namespace Drupal\Tests\simpletest\Unit;
use Drupal\Tests\Listeners\SimpletestUiPrinter;
use Drupal\Tests\UnitTestCase;
class SimpletestUiPrinterTest extends UnitTestCase {
public function provideBuffer() {
return [
[
'&"'<>',
'&"\'<>',
],
[
'<a href="http:////www.example.com" target="_blank" title="http:////www.example.com">http:////www.example.com</a>',
'http:////www.example.com',
],
[
'this is some text <a href="http://www.example.com/" target="_blank" title="http://www.example.com/">http://www.example.com/</a> with a link in it.',
'this is some text http://www.example.com/ with a link in it.',
],
[
"HTML output was generated<br />\n",
"HTML output was generated\n",
],
];
}
public function testWrite($expected, $buffer) {
$printer = new SimpletestUiPrinter();
$this
->expectOutputString($expected);
$printer
->write($buffer);
}
}