Skip to content

Commit a8c7b85

Browse files
author
Genert Org
committed
Parser tests
1 parent 066296e commit a8c7b85

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/ParserTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public function testBBCodeParsing()
2626
['input' => '[s]Yolo[/s]', 'excepted' => '<s>Yolo</s>'],
2727
['input' => '[code]Yolo[/code]', 'excepted' => '<code>Yolo</code>'],
2828
['input' => '[list]Yolo[/list]', 'excepted' => '<ul>Yolo</ul>'],
29+
['input' => '[img]Yolo[/img]', 'excepted' => '<img src="Yolo">'],
30+
['input' => '[table]Yolo[/table]', 'excepted' => '<table>Yolo</table>'],
31+
['input' => '[tr]Yolo[/tr]', 'excepted' => '<tr>Yolo</tr>'],
32+
['input' => '[td]Yolo[/td]', 'excepted' => '<td>Yolo</td>'],
2933
];
3034

3135
foreach ($tests as $test) {
@@ -41,7 +45,6 @@ public function testHtmlReturnsCorrectBBCode() {
4145
<u>underline</u>
4246
<s>line through</s>
4347
<blockquote>quote</blockquote>
44-
<blockquote><small>golonka</small>quote</blockquote>
4548
<a href="http://www.example.com">http://www.example.com</a>
4649
<a href="http://www.example.com">example.com</a>
4750
<img src="http://example.com/logo.png">
@@ -75,7 +78,6 @@ public function testHtmlReturnsCorrectBBCode() {
7578
[u]underline[/u]
7679
[s]line through[/s]
7780
[quote]quote[/quote]
78-
[quote][small]golonka[/small]quote[/quote]
7981
[url=http://www.example.com]http://www.example.com[/url]
8082
[url=http://www.example.com]example.com[/url]
8183
[img]http://example.com/logo.png[/img]
@@ -115,7 +117,6 @@ public function testBBCodeReturnsCorrectHtml() {
115117
[u]underline[/u]
116118
[s]line through[/s]
117119
[quote]quote[/quote]
118-
[quote][small]golonka[/small]quote[/quote]
119120
[url=http://www.example.com]http://www.example.com[/url]
120121
[url=http://www.example.com]example.com[/url]
121122
[img]http://example.com/logo.png[/img]
@@ -139,7 +140,6 @@ public function testBBCodeReturnsCorrectHtml() {
139140
<u>underline</u>
140141
<s>line through</s>
141142
<blockquote>quote</blockquote>
142-
<blockquote><small>golonka</small>quote</blockquote>
143143
<a href="http://www.example.com">http://www.example.com</a>
144144
<a href="http://www.example.com">example.com</a>
145145
<img src="http://example.com/logo.png">
@@ -220,8 +220,8 @@ public function testAddParser()
220220
);
221221

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

0 commit comments

Comments
 (0)