3 namespace Friendica\Test\src\Content\Text;
5 use Friendica\Content\Text\HTML;
6 use Friendica\Test\MockedTest;
7 use Friendica\Test\Util\AppMockTrait;
8 use Friendica\Test\Util\VFSTrait;
10 class HTMLTest extends MockedTest
15 protected function setUp()
19 $this->mockApp($this->root);
22 public function dataHTML()
24 $inputFiles = glob(__DIR__ . '/../../../datasets/content/text/html/*.html');
28 foreach ($inputFiles as $file) {
29 $data[str_replace('.html', '', $file)] = [
30 'input' => file_get_contents($file),
31 'expected' => file_get_contents(str_replace('.html', '.txt', $file))
39 * Test convert different input Markdown text into HTML
41 * @dataProvider dataHTML
43 * @param string $input The Markdown text to test
44 * @param string $expected The expected HTML output
47 public function testToPlaintext($input, $expected)
49 $output = HTML::toPlaintext($input, 0);
51 $this->assertEquals($expected, $output);