tm = $this->make('e107TinyMceParser'); } catch (Exception $e) { $this->fail("Couldn't load e107TinyMceParser object"); } } public function testToHtmlOnPlain() { $test = 'Plain text paragraph 1 Plain text "paragraph" 2 Plain text paragraph 3 '; $actual = $this->tm->toHtml($test); $expected = 'Plain text paragraph 1

Plain text "paragraph" 2

Plain text paragraph 3
'; $this->assertEquals($expected, $actual, "Plain text line-breaks to HTML failed in the TinyMce editor." ); } public function testToHtmlOnBbcode() { $test = '[b]Bold text[/b] paragraph 2 paragraph 3'; $actual = $this->tm->toHtml($test); $expected = "Bold text

paragraph 2

paragraph 3"; $this->assertEquals($expected, $actual, "Bbcode to HTML failed in the TinyMce editor." ); } public function testToBBcode() { $test_1 = ' 2 '; $actual_1 = $this->tm->toBBcode($test_1); $expected_1 = '[html] 2[/html]'; // echo $actual; $this->assertEquals($expected_1, $actual_1); $test_2 = '

E107 AboutSome text

E107 AboutSome other text

'; $actual_2 = $this->tm->toBBcode($test_2); $expected_2 = '[html]

[img class=bbcode-img-right&width=300]{e_MEDIA_IMAGE}2017-11/e107_about.png[/img]Some text

[img class=bbcode-img-left&width=600]{e_MEDIA_IMAGE}2017-11/e107_about.png[/img]Some other text

[/html]'; $this->assertEquals($expected_2, $actual_2); } }