Skip to content

Commit

Permalink
Parser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Genert Org committed Jul 18, 2017
1 parent 066296e commit a8c7b85
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public function testBBCodeParsing()
['input' => '[s]Yolo[/s]', 'excepted' => '<s>Yolo</s>'],
['input' => '[code]Yolo[/code]', 'excepted' => '<code>Yolo</code>'],
['input' => '[list]Yolo[/list]', 'excepted' => '<ul>Yolo</ul>'],
['input' => '[img]Yolo[/img]', 'excepted' => '<img src="Yolo">'],
['input' => '[table]Yolo[/table]', 'excepted' => '<table>Yolo</table>'],
['input' => '[tr]Yolo[/tr]', 'excepted' => '<tr>Yolo</tr>'],
['input' => '[td]Yolo[/td]', 'excepted' => '<td>Yolo</td>'],
];

foreach ($tests as $test) {
Expand All @@ -41,7 +45,6 @@ public function testHtmlReturnsCorrectBBCode() {
<u>underline</u>
<s>line through</s>
<blockquote>quote</blockquote>
<blockquote><small>golonka</small>quote</blockquote>
<a href="http://www.example.com">http://www.example.com</a>
<a href="http://www.example.com">example.com</a>
<img src="http://example.com/logo.png">
Expand Down Expand Up @@ -75,7 +78,6 @@ public function testHtmlReturnsCorrectBBCode() {
[u]underline[/u]
[s]line through[/s]
[quote]quote[/quote]
[quote][small]golonka[/small]quote[/quote]
[url=http://www.example.com]http://www.example.com[/url]
[url=http://www.example.com]example.com[/url]
[img]http://example.com/logo.png[/img]
Expand Down Expand Up @@ -115,7 +117,6 @@ public function testBBCodeReturnsCorrectHtml() {
[u]underline[/u]
[s]line through[/s]
[quote]quote[/quote]
[quote][small]golonka[/small]quote[/quote]
[url=http://www.example.com]http://www.example.com[/url]
[url=http://www.example.com]example.com[/url]
[img]http://example.com/logo.png[/img]
Expand All @@ -139,7 +140,6 @@ public function testBBCodeReturnsCorrectHtml() {
<u>underline</u>
<s>line through</s>
<blockquote>quote</blockquote>
<blockquote><small>golonka</small>quote</blockquote>
<a href="http://www.example.com">http://www.example.com</a>
<a href="http://www.example.com">example.com</a>
<img src="http://example.com/logo.png">
Expand Down Expand Up @@ -220,8 +220,8 @@ public function testAddParser()
);

$this->assertEquals(
$bbCode->convertToHtml('[link target=www.yourlinkhere.com]Text to be displayed[/link].'),
'<a href="www.yourlinkhere.com">Text to be displayed</a>.'
$bbCode->convertToHtml('[link target=http://www.example.com]Text to be displayed[/link].'),
'<a href="http://www.example.com">Text to be displayed</a>.'
);
}

Expand Down

0 comments on commit a8c7b85

Please sign in to comment.